<br><font size=2 face="sans-serif">Marcus,</font>
<br>
<br><font size=2 face="sans-serif">CC.rb version 1.1 doesn't change RAILS_ENV,
either (earlier versions did).</font>
<br>
<br><font size=2 face="sans-serif">If you want to try and force it to be
'test' before 'spec' task is invoked, try this:</font>
<br>
<br><tt><font size=2> desc 'Continuous build target'<br>
task :cruise do</font></tt>
<br><tt><font size=2> ENV['RAILS_ENV'] = 'test'<br>
Rake::Task['spec'].invoke<br>
end<br>
</font></tt>
<br><tt><font size=2>If that doesn't help, please send me your Rakefile
(or whatever needed to reproduce the issue) off-list, and I'll look into
it.</font></tt>
<br>
<br><font size=2 face="sans-serif">Best regards,</font>
<br><font size=2 face="sans-serif">Alex</font>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Marcus Crafter <marcus@marcuscrafter.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: cruisecontrolrb-users-bounces@rubyforge.org</font>
<p><font size=1 face="sans-serif">04/16/2007 08:54 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">cruisecontrolrb-users@rubyforge.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Cruisecontrolrb-users] CC.rb,
rails and rspec tests using production database?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hi Jeff,<br>
<br>
Thanks for your response - just gave that a go, but unfortunately the <br>
same error occurs - it seems that it's able to run the spec's, just <br>
that they all fail due to the wrong database:<br>
<br>
1) ActiveRecord::StatementInvalid in 'A new Activation object should <br>
be invalid without a name' Mysql::Error: Table <br>
'cms_production.activations' doesn't exist: SHOW FIELDS FROM <br>
activations ./spec/models/activation_spec.rb:7:<br>
......<br>
<br>
I've checked my project all over, and there's no setting of the <br>
RAILS_ENV to production anywhere, and a rake spec on the command line <br>
works fine with the right database.<br>
<br>
Still digging in to it..<br>
<br>
Cheers,<br>
<br>
Marcus<br>
<br>
<br>
On 17/04/2007, at 12:43 PM, Jeff Xiong wrote:<br>
<br>
> Have you tried to create a /lib/tasks/cruise.rake file, then invoke<br>
> 'spec' task in it?<br>
><br>
> desc 'Continuous build target'<br>
> task :cruise do<br>
> Rake::Task["speck"].invoke<br>
> end<br>
><br>
> CC.rb prefers 'cruise' rake task.<br>
><br>
> On 4/17/07, Marcus Crafter <marcus@marcuscrafter.com> wrote:<br>
>> Hi All,<br>
>><br>
>> Hope all is going well.<br>
>><br>
>> Just installed CC.rb in my development environment here and it
looks<br>
>> great. Top stuff.<br>
>><br>
>> I was able to get my Rails project registered and building properly<br>
>> which was awesome.<br>
>><br>
>> I'm using RSpec for my tests rather than Test::Unit, so I modified<br>
>> the project.rake_task to be 'spec' rather than commented out,
however<br>
>> it seems that CC.rb now tries to run my spec's over the production<br>
>> database rather than the test database.<br>
>><br>
>> Running a 'rake spec' from the command line with the same project<br>
>> works fine as expected, however unfortunately through CC.rb it
fails.<br>
>><br>
>> Anyone got any thoughts where things might be wrong with the<br>
>> configuration of what database to use? or any pointers where to
take<br>
>> a look?<br>
>><br>
>> Thanks for any thoughts, ideas.<br>
>><br>
>> Cheers,<br>
>><br>
>> Marcus<br>
>> _______________________________________________<br>
>> Cruisecontrolrb-users mailing list<br>
>> Cruisecontrolrb-users@rubyforge.org<br>
>> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users<br>
>><br>
><br>
><br>
> --<br>
> Jeff Xiong<br>
> Software Journeyman - http://gigix.thoughtworkers.org<br>
> Open Source Contributor - http://cruisecontrolrb.thoughtworks.com/<br>
> Technical Evangelist - http://www.infoq.com/cn/<br>
> _______________________________________________<br>
> Cruisecontrolrb-users mailing list<br>
> Cruisecontrolrb-users@rubyforge.org<br>
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users<br>
<br>
_______________________________________________<br>
Cruisecontrolrb-users mailing list<br>
Cruisecontrolrb-users@rubyforge.org<br>
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users<br>
<br>
______________________________________________________________________<br>
This email has been scanned by the MessageLabs Email Security System.<br>
For more information please visit http://www.messagelabs.com/email <br>
______________________________________________________________________<br>
</font></tt>
<br>