[rspec-users] Possible Problem with RSpec and

Stefan Magnus Landrø stefan.landro at gmail.com
Wed Nov 28 08:16:44 EST 2007


I believe I was a bit quick on this one....

Of course, if you can't run your tests, the build should fail and return
non-0 as fast as possible.

However, it would be nice to distinguish between errors and failures. I
initially thought rake would output "rake aborted!" only when you have
errors - not just failing tests, and as a ruby newbie I sometimes found it
hard to know if I had an error or just a failing test.

Does this make more sense?

Stefan

2007/11/28, aslak hellesoy <aslak.hellesoy at gmail.com>:
>
> On 11/28/07, Stefan Magnus Landrø <stefan.landro at gmail.com> wrote:
> > We saw some annoying behavior related to pending tests. Maybe you could
> > delete it and rerun your specs?
> >
> > An error typically indicates that you have some sort of error in your
> code -
> > failing tests should not cause rake to abort.
> >
>
> It does, and it should. Failures are just as fatal as errors, and
> should make rake exit with a non-0.
>
> Aslak
>
> > Stefan
> >
> > 2007/11/25, James B. Byrne <byrnejb at harte-lyne.ca>:
> > > Sorry to be such a pest but I am trying to learn Ruby, Rails and RSpec
> all
> > > at one go and it is a bit overwhelming.  I have previously completed
> the
> > > depot tutorial in the Agile Web Dev with rails book and now I am
> trying do
> > > do it again using RSpec.
> > >
> > > What I would like to know now is why I am getting a rake failure error
> at
> > > the end of every spec:models run.  Is this the expected behaviour when
> a
> > > test / expectation fails?
> > >
> > > --->
> > >
> > > C:\var\RSpec\depot>rake spec:models
> > > (in C:/var/RSpec/depot)
> > > NOTICE:  CREATE TABLE will create implicit sequence "products_id_seq"
> for
> > > serial
> > > column " products.id"
> > > NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> > > "products_pkey" f
> > > or table "products"
> > >
> > > Product
> > > - should have a valid image uri (PENDING: Not Yet Implemented)
> > > - should have a description
> > > - should have a title (FAILED - 1)
> > >
> > > Pending:
> > > Product should have a valid image uri (Not Yet Implemented)
> > >
> > > 1)
> > > 'Product should have a title' FAILED
> > > expected valid? to return true, got false
> > > ./spec/models/product_spec.rb:11:
> > >
> > > Finished in 0.75 seconds
> > >
> > > 3 examples, 1 failure, 1 pending
> > > rake aborted!
> > > Command ruby -I
> > > "C:/var/RSpec/depot/vendor/plugins/rspec/lib"
> > > "C:/var/RSpec/depot/vendor/plugins/rspec/bin/spec"
> > > "spec/models/product_spec.rb"
> > > --options
> > > "C:/var/RSpec/depot/config/../spec/spec.opts" failed
> > >
> > > (See full trace by running task with --trace)
> > >
> > > C:\var\RSpec\depot>rake spec:models --trace
> > > (in C:/var/RSpec/depot)
> > > ** Invoke spec:models (first_time)
> > > ** Invoke db:test:prepare (first_time)
> > > ** Invoke environment (first_time)
> > > ** Execute environment
> > > ** Execute db:test:prepare
> > > ** Invoke db:test:clone (first_time)
> > > ** Invoke db:schema:dump (first_time)
> > > ** Invoke environment
> > > ** Execute db:schema:dump
> > > ** Invoke db:test:purge (first_time)
> > > ** Invoke environment
> > > ** Execute db:test:purge
> > > ** Execute db:test:clone
> > > ** Invoke db:schema:load (first_time)
> > > ** Invoke environment
> > > ** Execute db:schema:load
> > > NOTICE:  CREATE TABLE will create implicit sequence "products_id_seq"
> for
> > > serial column "products.id"
> > > NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> > > "products_pkey" for table "products"
> > > ** Execute spec:models
> > >
> > > Product
> > > - should have a valid image uri (PENDING: Not Yet Implemented)
> > > - should have a description
> > > - should have a title (FAILED - 1)
> > >
> > > Pending:
> > > Product should have a valid image uri (Not Yet Implemented)
> > >
> > > 1)
> > > 'Product should have a title' FAILED
> > > expected valid? to return true, got false
> > > ./spec/models/product_spec.rb:11:
> > >
> > > Finished in 0.563 seconds
> > >
> > > 3 examples, 1 failure, 1 pending
> > > rake aborted!
> > > Command ruby
> > -I"C:/var/RSpec/depot/vendor/plugins/rspec/lib"
> > > "C:/var/RSpec/depot/vendor/plugins/rspec/bin/spec"
> > "spec/models/
> > > product_spec.rb" --options
> > "C:/var/RSpec/depot/config/../spec/spec.opts"
> > > failed
> > > C:/var/RSpec/depot/vendor/plugins/rspec/lib/spec/rake/
> > > spectask.rb:173:in `define'
> > > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-
> > 0.7.3/lib/
> > > rake.rb:823:in `verbose'
> > > C:/var/RSpec/depot/vendor/plugins/rspec/lib/spec/rake/
> > > spectask.rb:142:in `define'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:392:in `call'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:392:in `execute'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:392:in `each'
> > > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-
> > 0.7.3/lib/
> > > rake.rb:392:in `execute'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:362:in `invoke'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:355:in `synchronize'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:355:in `invoke'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1739:in `top_level'
> > > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-
> > 0.7.3/lib/
> > > rake.rb:1739:in `each'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1739:in `top_level'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1761:in `standard_exception_handling'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1733:in `top_level'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1711:in `run'
> > > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-
> > 0.7.3/lib/
> > > rake.rb:1761:in `standard_exception_handling'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/
> > > rake.rb:1708:in `run'
> > >
> > C:/usr/local/bin/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
> > > C:/usr/local/bin/ruby/bin/rake.bat:20:in `load'
> > > C:/usr/local/bin/ruby/bin/rake.bat:20
> > >
> > > C:\var\RSpec\depot>
> > > <---
> > >
> > >
> > > --
> > > ***          E-Mail is NOT a SECURE channel          ***
> > > James B. Byrne                mailto: ByrneJB at Harte-Lyne.ca
> > > Harte & Lyne Limited          http://www.harte-lyne.ca
> > > 9 Brockley Drive              vox: +1 905 561 1241
> > > Hamilton, Ontario             fax: +1 905 561 0757
> > > Canada  L8E 3C3
> > >
> > > _______________________________________________
> > > rspec-users mailing list
> > > rspec-users at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-users
> > >
> >
> >
> >
> > --
> > Bekk Open Source
> > http://boss.bekk.no
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Bekk Open Source
http://boss.bekk.no
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071128/c416f04a/attachment.html 


More information about the rspec-users mailing list