Geoffrey Wiseman
2007-Sep-05 17:11 UTC
[rspec-users] False Positives and Autotest on New Folders
False Positives I just discovered how easy it was to create a false positive when I, trying my first RSpec test, did this: ob.should eql?(''foo'') instead of: ob.should eql(''foo'') or: ob.should == ''foo'' As far as I can see, this is roughly equivalent to: ob.should false Neither eql?(''foo'') nor false causes the spec to fail; this is worrisome, as I can imagine accidentally including that ? again; and I''d hate it to mask a test failure. Autotest Out of curiosity, does anyone know how to get autotest to pick up new folders under spec/? Seems like I might have to modify rails_rspec.rb in lib/autotest. We were considering separating our acceptance tests from the rest. - Geoffrey -- Geoffrey Wiseman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070905/dd3f3b88/attachment.html
David Chelimsky
2007-Sep-05 19:53 UTC
[rspec-users] False Positives and Autotest on New Folders
On 9/5/07, Geoffrey Wiseman <geoffrey.wiseman at gmail.com> wrote:> False Positives > I just discovered how easy it was to create a false positive when I, trying > my first RSpec test, did this: > ob.should eql?(''foo'') > instead of: > ob.should eql(''foo'') > or: > ob.should == ''foo'' > > As far as I can see, this is roughly equivalent to: > ob.should false > > Neither eql?(''foo'') nor false causes the spec to fail; this is worrisome, as > I can imagine accidentally including that ? again; and I''d hate it to mask a > test failure.Please report bugs to http://rubyforge.org/tracker/index.php?group_id=797> > Autotest > Out of curiosity, does anyone know how to get autotest to pick up new > folders under spec/? Seems like I might have to modify rails_rspec.rb in > lib/autotest. We were considering separating our acceptance tests from the > rest. > > - Geoffrey > -- > Geoffrey Wiseman > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2007-Sep-05 19:54 UTC
[rspec-users] False Positives and Autotest on New Folders
On 9/5/07, Geoffrey Wiseman <geoffrey.wiseman at gmail.com> wrote:> False Positives > I just discovered how easy it was to create a false positive when I, trying > my first RSpec test, did this: > ob.should eql?(''foo'') > instead of: > ob.should eql(''foo'') > or: > ob.should == ''foo'' > > As far as I can see, this is roughly equivalent to: > ob.should false > > Neither eql?(''foo'') nor false causes the spec to fail; this is worrisome, as > I can imagine accidentally including that ? again; and I''d hate it to mask a > test failure. > > Autotest > Out of curiosity, does anyone know how to get autotest to pick up new > folders under spec/? Seems like I might have to modify rails_rspec.rb in > lib/autotest. We were considering separating our acceptance tests from the > rest.You could either modify rails_rspec.rb, or you could add a .autotest file in the project root and rewrite the mappings there. See autotests docs for how to do that (look for info on hooks).> > - Geoffrey > -- > Geoffrey Wiseman > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Geoffrey Wiseman
2007-Sep-07 18:55 UTC
[rspec-users] False Positives and Autotest on New Folders
On 9/5/07, David Chelimsky <dchelimsky at gmail.com> wrote:> > > Autotest > > Out of curiosity, does anyone know how to get autotest to pick up new > > folders under spec/? Seems like I might have to modify rails_rspec.rb > in > > lib/autotest. We were considering separating our acceptance tests from > the > > rest. > > You could either modify rails_rspec.rb, or you could add a .autotest > file in the project root and rewrite the mappings there. See autotests > docs for how to do that (look for info on hooks).Unfortunately when rails_rspec.rb runs, it seems to write over anything established in .autotest. Should I file a bug on that as well? loading autotest/rails_rspec Mappings @ .autotest: (?-mix:^test\/test_.*rb$) => #<Proc:0xb7b2c6ec@/usr/lib/ruby/gems/1.8/gems/ZenTest-3.6.1 /lib/autotest.rb:152> (?-mix:^spec\/(models|controllers|views|helpers|lib|acceptance)\/.*rb$) => #<Proc:0xb7b21c88 at ./.autotest:51> (?-mix:^lib\/.*\.rb$) => #<Proc:0xb7b2c87c@/usr/lib/ruby/gems/1.8/gems/ZenTest-3.6.1 /lib/autotest.rb:149> Mappings @ rails_rspec.rb: (?-mix:^(spec\/(spec_helper|shared\/.*)|config\/(boot|environment(s\/test)?))\.rb$) => #<Proc:0xb7ab4750 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:68> (?-mix:^app\/controllers\/(.*)\.rb$) => #<Proc:0xb7ab5434 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:46> (?-mix:^app\/models\/(.*)\.rb$) => #<Proc:0xb7ab5920 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:40> (?-mix:^app\/helpers\/(.*)_helper\.rb$) => #<Proc:0xb7ab4f0c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:49> (?-mix:^spec\/(models|controllers|views|helpers|lib)\/.*rb$) => #<Proc:0xb7ab5b8c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:37> (?-mix:^config\/database\.yml$) => #<Proc:0xb7ab48a4 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:65> (?-mix:^app\/views\/(.*)$) => #<Proc:0xb7ab56a0 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:43> (?-mix:^config\/routes\.rb$) => #<Proc:0xb7ab4a84 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:62> (?-mix:^app\/helpers\/application_helper\.rb$) => #<Proc:0xb7ab4db8 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:56> (?-mix:^(test|spec)\/fixtures\/(.*).yml$) => #<Proc:0xb7ab5d1c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:34> (?-mix:^lib\/(.*)\.rb$) => #<Proc:0xb7ab44e4 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:71> (?-mix:^app\/controllers\/application\.rb$) => #<Proc:0xb7ab4bd8 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:59> - Geoffrey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070907/ec628e3f/attachment.html
David Chelimsky
2007-Sep-07 19:03 UTC
[rspec-users] False Positives and Autotest on New Folders
On 9/7/07, Geoffrey Wiseman <geoffrey.wiseman at gmail.com> wrote:> On 9/5/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > Autotest > > > Out of curiosity, does anyone know how to get autotest to pick up new > > > folders under spec/? Seems like I might have to modify rails_rspec.rb > in > > > lib/autotest. We were considering separating our acceptance tests from > the > > > rest. > > > > You could either modify rails_rspec.rb, or you could add a .autotest > > file in the project root and rewrite the mappings there. See autotests > > docs for how to do that (look for info on hooks). > > > Unfortunately when rails_rspec.rb runs, it seems to write over anything > established in .autotest. Should I file a bug on that as well?Sure.> > loading autotest/rails_rspec > Mappings @ .autotest: > (?-mix:^test\/test_.*rb$) => > #<Proc:0xb7b2c6ec@/usr/lib/ruby/gems/1.8/gems/ZenTest-3.6.1/lib/autotest.rb:152> > > (?-mix:^spec\/(models|controllers|views|helpers|lib|acceptance)\/.*rb$) > => #<Proc:0xb7b21c88 at ./.autotest:51> > (?-mix:^lib\/.*\.rb$) => > #<Proc:0xb7b2c87c@/usr/lib/ruby/gems/1.8/gems/ZenTest-3.6.1/lib/autotest.rb:149> > Mappings @ rails_rspec.rb: > > (?-mix:^(spec\/(spec_helper|shared\/.*)|config\/(boot|environment(s\/test)?))\.rb$) > => > #<Proc:0xb7ab4750 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:68> > (?-mix:^app\/controllers\/(.*)\.rb$) => > #<Proc:0xb7ab5434 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:46> > (?-mix:^app\/models\/(.*)\.rb$) => > #<Proc:0xb7ab5920 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:40> > (?-mix:^app\/helpers\/(.*)_helper\.rb$) => > #<Proc:0xb7ab4f0c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:49> > > (?-mix:^spec\/(models|controllers|views|helpers|lib)\/.*rb$) > => > #<Proc:0xb7ab5b8c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:37> > (?-mix:^config\/database\.yml$) => > #<Proc:0xb7ab48a4 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:65> > (?-mix:^app\/views\/(.*)$) => > #<Proc:0xb7ab56a0 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:43> > (?-mix:^config\/routes\.rb$) => > #<Proc:0xb7ab4a84 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:62> > (?-mix:^app\/helpers\/application_helper\.rb$) => > #<Proc:0xb7ab4db8 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:56> > (?-mix:^(test|spec)\/fixtures\/(.*).yml$) => > #<Proc:0xb7ab5d1c at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:34> > (?-mix:^lib\/(.*)\.rb$) => > #<Proc:0xb7ab44e4 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:71> > (?-mix:^app\/controllers\/application\.rb$) => > #<Proc:0xb7ab4bd8 at ./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:59>> > - Geoffrey > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >