> I guess it only excludes the directory it runs from? It bases patterns from that yes.
> I'd need to add each directory I am working in? No, you need to add the directory the spec files are in. You can get that with `File.expand_path(__FILE__, ’/..’)` Jon Rowe --------------------------- [email protected] jonrowe.co.uk On Friday, 1 January 2016 at 12:11, Cliff Rosson wrote: > Re-reading Jon's post. I guess it only excludes the directory it runs from? > I'd need to add each directory I am working in? > > Just to spell it out, sorry if I am being dense, can I just have ruby read > the directory I am currently in then add that folder to the exclusion list? > > On Thursday, December 31, 2015 at 5:07:31 PM UTC-8, Cliff Rosson wrote: > > Thanks everyone. So I just made some changes to my example file and tested > > again. I still have the same issue on rspec3. Any thoughts? > > > > > #!/usr/bin/ruby > > > require 'rspec/autorun' > > > require 'net/ping' > > > > > > > > > RSpec.configure do |config| > > > config.full_backtrace=false > > > end > > > > > > describe "TEST A >> " do > > > it "1:Ping is true >> " do > > > host = Net::Ping::External.new("www.google.com > > > (http://www.google.com)") > > > expect(host.ping?).to be false > > > end > > > end > > > > > > > > > > > If I call the file directly I get no traceback. If I call the symlink I do. > > If I call the symlink from my bin directory, where it exists, then I don't. > > > > > Cliffords-iMac:Desktop crosson$ /Users/crosson/Desktop/scratch/example.rb > > > > > > F > > > > > > Failures: > > > > > > 1) TEST A >> 1:Ping is true >> > > > Failure/Error: expect(host.ping?).to be false > > > > > > expected false > > > got true > > > # ./scratch/example.rb:13:in `block (2 levels) in <main>' > > > > > > Finished in 0.03627 seconds (files took 0.14898 seconds to load) > > > 1 example, 1 failure > > > > > > Failed examples: > > > > > > rspec ./scratch/example.rb:11 # TEST A >> 1:Ping is true >> > > > > > > Cliffords-iMac:Desktop crosson$ example > > > F > > > > > > Failures: > > > > > > 1) TEST A >> 1:Ping is true >> > > > Failure/Error: expect(host.ping?).to be false > > > > > > expected false > > > got true > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-support-3.4.1/lib/rspec/support.rb:87:in > > > `block in <module:Support>' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-support-3.4.1/lib/rspec/support.rb:96:in > > > `call' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-support-3.4.1/lib/rspec/support.rb:96:in > > > `notify_failure' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/fail_with.rb:27:in > > > `fail_with' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/handler.rb:40:in > > > `handle_failure' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/handler.rb:50:in > > > `block in handle_matcher' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/handler.rb:27:in > > > `with_matcher' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/handler.rb:48:in > > > `handle_matcher' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-3.4.0/lib/rspec/expectations/expectation_target.rb:54:in > > > `to' > > > # /Users/crosson/bin/example:13:in `block (2 levels) in <main>' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:236:in > > > `instance_exec' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:236:in > > > `block in run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:477:in > > > `block in with_around_and_singleton_context_hooks' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:434:in > > > `block in with_around_example_hooks' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/hooks.rb:478:in > > > `block in run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/hooks.rb:616:in > > > `run_around_example_hooks_for' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/hooks.rb:478:in > > > `run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:434:in > > > `with_around_example_hooks' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:477:in > > > `with_around_and_singleton_context_hooks' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example.rb:233:in > > > `run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:581:in > > > `block in run_examples' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:577:in > > > `map' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:577:in > > > `run_examples' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:543:in > > > `run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:115:in > > > `block (3 levels) in run_specs' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:115:in > > > `map' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:115:in > > > `block (2 levels) in run_specs' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1680:in > > > `with_suite_hooks' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:114:in > > > `block in run_specs' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/reporter.rb:77:in > > > `report' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:113:in > > > `run_specs' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:89:in > > > `run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in > > > `run' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in > > > `invoke' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:34:in > > > `perform_at_exit' > > > # > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:20:in > > > `block in autorun' > > > # > > > # Showing full backtrace because every line was filtered out. > > > # See docs for RSpec::Configuration#backtrace_exclusion_patterns > > > and > > > # RSpec::Configuration#backtrace_inclusion_patterns for more > > > information. > > > > > > Finished in 0.03689 seconds (files took 0.15154 seconds to load) > > > 1 example, 1 failure > > > > > > Failed examples: > > > > > > rspec /Users/crosson/bin/example:11 # TEST A >> 1:Ping is true >> > > > > > > Cliffords-iMac:Desktop crosson$ ls ~/bin/ > > > example > > > Cliffords-iMac:Desktop crosson$ ls -l ~/bin/ > > > total 8 > > > lrwxr-xr-x 1 crosson staff 41 Dec 31 16:59 example -> > > > /Users/crosson/Desktop/scratch/example.rb > > > > > > > > > > > > > > > > > > Cliffords-iMac:Desktop crosson$ cd ~/bin/ > > > Cliffords-iMac:bin crosson$ example > > > F > > > > > > Failures: > > > > > > 1) TEST A >> 1:Ping is true >> > > > Failure/Error: expect(host.ping?).to be false > > > > > > expected false > > > got true > > > # ./example:13:in `block (2 levels) in <main>' > > > > > > Finished in 0.03574 seconds (files took 0.16152 seconds to load) > > > 1 example, 1 failure > > > > > > Failed examples: > > > > > > rspec ./example:11 # TEST A >> 1:Ping is true >> > > > > On Thursday, December 31, 2015 at 4:52:42 PM UTC-8, Myron Marston wrote: > > > Our website has detailed upgrade instructions: > > > > > > http://rspec.info/upgrading-from-rspec-2/ > > > > > > Besides upgrading to 2.99 first, the other important thing is using > > > transpec. > > > > > > HTH, > > > Myron > > > > > > > > > On Thu, Dec 31, 2015 at 4:51 PM, Cliff Rosson <[email protected]> wrote: > > > > Thanks Jon. I'll give it a shot. I ran into some semantic issues when > > > > rspec released 3.0 some time ago but in reading the docs nothing really > > > > stands out on why rspec3 wouldn't work for me. > > > > > > > > On Thursday, December 31, 2015 at 4:08:09 PM UTC-8, Jon Rowe wrote: > > > > > Full backtrace is actually designed to force a full backtrace > > > > > display, turning it off merely uses the default inclusion / exclusion > > > > > filters, by default (if I remember correctly) this includes stuff > > > > > based on your working directory; so if you manually add the directory > > > > > (even if you use ruby to generate it from the file rather than the > > > > > working directory) to the exclusion filter it should be removed no > > > > > matter where you run the test from. > > > > > > > > > > There’s been a fair amount of work on improving this behaviour in > > > > > RSpec 3 and given that RSpec 2 isn’t supported I heartily recommend > > > > > you upgrade to the latest version, if you install 2.99 first it will > > > > > be relatively painless! > > > > > > > > > > Cheers > > > > > Jon > > > > > > > > > > > > > > > Jon Rowe > > > > > --------------------------- > > > > > [email protected] > > > > > jonrowe.co.uk (http://jonrowe.co.uk) > > > > > > > > > > > > > > > On Friday, 1 January 2016 at 04:52, Cliff Rosson wrote: > > > > > > > > > > > > > > > > > > > > > Versions. > > > > > > > > > > > > rspec (2.14.1) > > > > > > rspec-core (2.14.8) > > > > > > rspec-expectations (2.14.5) > > > > > > rspec-mocks (2.14.6) > > > > > > > > > > > > On Wednesday, December 30, 2015 at 9:52:45 PM UTC-8, Cliff Rosson > > > > > > wrote: > > > > > > > Hi Folk, > > > > > > > > > > > > > > Hopefully this is a very simple question. I use RSPEC as a > > > > > > > functional test for network maintenances. It allows me to loop a > > > > > > > series of tests during a maintenance providing a clean format and > > > > > > > notification of any behavioral changes on the network. > > > > > > > > > > > > > > Often times I expect some things to fail and in an attempt to > > > > > > > keep results clean I often want to hide the full backtrace. If I > > > > > > > run my rspec with the config.full_backtrace argument set to false > > > > > > > everything works great. If I symlink the file however the > > > > > > > backtraces return. > > > > > > > > > > > > > > I wrote this example to illustrate my issue. > > > > > > > > #!/usr/bin/ruby > > > > > > > > require 'rspec/autorun' > > > > > > > > require 'net/ping' > > > > > > > > > > > > > > > > > > > > > > > > RSpec.configure do |config| > > > > > > > > config.full_backtrace=false > > > > > > > > end > > > > > > > > > > > > > > > > describe "TEST A >> " do > > > > > > > > it "1:Ping is true >> " do > > > > > > > > host = Net::Ping::External.new("www.google.com > > > > > > > > (http://www.google.com)") > > > > > > > > host.ping?.should be_false > > > > > > > > end > > > > > > > > end > > > > > > > > > > > > > > > > > > > > > if I run this directly it works great. > > > > > > > > /test_rspec.rb > > > > > > > > F > > > > > > > > > > > > > > > > Failures: > > > > > > > > > > > > > > > > 1) TEST A >> 1:Ping is true >> > > > > > > > > Failure/Error: Unable to find matching line from backtrace > > > > > > > > expected: false value > > > > > > > > got: true > > > > > > > > # ./test_rspec.rb:13:in `block (2 levels) in <main>' > > > > > > > > > > > > > > > > Finished in 0.01479 seconds > > > > > > > > 1 example, 1 failure > > > > > > > > > > > > > > > > Failed examples: > > > > > > > > > > > > > > > > rspec ./test_rspec.rb:11 # TEST A >> 1:Ping is true >> > > > > > > > > > > > > > > > > > > > > > Nice and clean output. > > > > > > > However if I symlink the file I get the full backtrace which I > > > > > > > really just would rather ignore. > > > > > > > > ls -l ~/bin/ > > > > > > > > > > > > > > > > total 24 > > > > > > > > > > > > > > > > lrwxr-xr-x 1 cliff.rosson USERS\Domain Users 49 Dec 30 16:56 > > > > > > > > test_rspec -> /Users/cliff.rosson/Desktop/scratch/test_rspec.rb > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > And run the symlink > > > > > > > > test_rspec > > > > > > > > > > > > > > > > F > > > > > > > > > > > > > > > > > > > > > > > > Failures: > > > > > > > > > > > > > > > > 1) TEST A >> 1:Ping is true >> > > > > > > > > Failure/Error: host.ping?.should be_false > > > > > > > > > > > > > > > > expected: false value > > > > > > > > > > > > > > > > got: true > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-2.14.5/lib/rspec/expectations/fail_with.rb:32:in > > > > > > > > `fail_with' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-2.14.5/lib/rspec/expectations/handler.rb:36:in > > > > > > > > `handle_matcher' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-expectations-2.14.5/lib/rspec/expectations/syntax.rb:53:in > > > > > > > > `should' > > > > > > > > > > > > > > > > # /Users/cliff.rosson/bin/test_rspec:13:in `block (2 > > > > > > > > levels) in <main>' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:114:in > > > > > > > > `instance_eval' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:114:in > > > > > > > > `block in run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:254:in > > > > > > > > `with_around_each_hooks' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:111:in > > > > > > > > `run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:390:in > > > > > > > > `block in run_examples' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:386:in > > > > > > > > `map' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:386:in > > > > > > > > `run_examples' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:371:in > > > > > > > > `run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:28:in > > > > > > > > `block (2 levels) in run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:28:in > > > > > > > > `map' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:28:in > > > > > > > > `block in run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/reporter.rb:58:in > > > > > > > > `report' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:25:in > > > > > > > > `run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in > > > > > > > > `run' > > > > > > > > > > > > > > > > # > > > > > > > > /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in > > > > > > > > `block in autorun' > > > > > > > > > > > > > > > > > > > > > > > > Finished in 0.01452 seconds > > > > > > > > 1 example, 1 failure > > > > > > > > > > > > > > > > > > > > > > > > Failed examples: > > > > > > > > > > > > > > > > rspec /Users/cliff.rosson/bin/test_rspec:11 # TEST A >> 1:Ping > > > > > > > > is true >> > > > > > > > > > > > > > > Any-thoughts why this setting doesn't carry over when referencing > > > > > > > the symlink? > > > > > > > > > > > > > > Thanks everyone. > > > > > > > > > > > > > -- > > > > > > You received this message because you are subscribed to the Google > > > > > > Groups "rspec" group. > > > > > > To unsubscribe from this group and stop receiving emails from it, > > > > > > send an email to [email protected]. > > > > > > To post to this group, send email to [email protected]. > > > > > > To view this discussion on the web visit > > > > > > https://groups.google.com/d/msgid/rspec/62b49200-336a-4f42-8537-a82d536ecf8b%40googlegroups.com > > > > > > > > > > > > (https://groups.google.com/d/msgid/rspec/62b49200-336a-4f42-8537-a82d536ecf8b%40googlegroups.com?utm_medium=email&utm_source=footer). > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "rspec" group. > > > > To unsubscribe from this group and stop receiving emails from it, send > > > > an email to [email protected]. > > > > To post to this group, send email to [email protected]. > > > > To view this discussion on the web visit > > > > https://groups.google.com/d/msgid/rspec/4f6e5a17-e808-4f4c-8cfd-f734c9bed45a%40googlegroups.com > > > > > > > > (https://groups.google.com/d/msgid/rspec/4f6e5a17-e808-4f4c-8cfd-f734c9bed45a%40googlegroups.com?utm_medium=email&utm_source=footer). > > > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "rspec" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > To view this discussion on the web visit > https://groups.google.com/d/msgid/rspec/43dbe9de-59fd-44f2-a009-236c43f39eac%40googlegroups.com > > (https://groups.google.com/d/msgid/rspec/43dbe9de-59fd-44f2-a009-236c43f39eac%40googlegroups.com?utm_medium=email&utm_source=footer). > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/0064257E07314AA7B36E1EB82257017C%40jonrowe.co.uk. For more options, visit https://groups.google.com/d/optout.
