[rspec-users] rspec with CI

Alex Edwards alex.edwards at workingmouse.com
Mon Apr 16 23:26:16 EDT 2007

I had that problem too.  I ended up just changing my database.yml in my 
projects/work directory so that production pointed towards the correct 
database.  As my database.yml file is not in source control, this works 
ok as a workaround.  But the problem I am facing is different to that.

When I run the spec:app task form cc, spec failures do not result in a 
build failure.  As I said, I think this is because the spec task uses 
the ruby() method to invoke the specs, and that method is not 
propagating the spec failure out to the build.  I am hoping there might 
be an option I can pass to the spec that would tell it to reraise any 
errors, or maybe just a different rake task I can use to invoke my specs?

Marcus Crafter wrote:
> Hi Alex,
> I'm having a similar problem with CC.rb at the moment - from what I  
> can see, CC.rb is trying to run my spec's using the production  
> database, rather than the test one:
> 1) ActiveRecord::StatementInvalid in 'A new Activation object should  
> be invalid without a name' Mysql::Error: Table  
> 'cms_production.activations' doesn't exist: SHOW FIELDS FROM  
> activations ./spec/models/activation_spec.rb:7:
> ...
> Naturally this causes all of the specs to fail. :-/
> Running the same 'rake spec' on the command line in my rails app  
> works as expected.
> I don't have a solution just yet but have also asked if others were  
> having this problem on the cc.rb users mailing list - hopefully we'll  
> have a solution to it soon.
> If this isn't the problem you're having - would be good to know so we  
> can sort that out too. At least you're not the only one :)
> Cheers,
> Marcus
> On 17/04/2007, at 12:23 PM, Alex Edwards wrote:
>> I am a bit of a rails and rspec noob.
>> I am trying to use rspec in conjunction with CruiseControlrb.
>> When I run a cruise build having spec errors, the build does not
>> indicate a failure.  I have tried to track down why this is the case,
>> and my best guess is that the spec task is kicking off the spec via a
>> ruby() method in rake, and that ruby method does not propagate my spec
>> failure back to rake.
>> Any help in setting this up would be much appreciated.
>> Also, if there is a better alternative to cruisecontrolrb that
>> integrates nicely with rspec, please let me know.
>> Thanks
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070417/6ea6d559/attachment-0001.html 

More information about the rspec-users mailing list