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