<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>&nbsp; desc 'Continuous build target'<br>
 &nbsp;task :cruise do</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; ENV['RAILS_ENV'] = 'test'<br>
 &nbsp; &nbsp;Rake::Task['spec'].invoke<br>
 &nbsp;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 &lt;marcus@marcuscrafter.com&gt;</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, &nbsp;
&nbsp; &nbsp; &nbsp;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 &nbsp;<br>
same error occurs - it seems that it's able to run the spec's, just &nbsp;<br>
that they all fail due to the wrong database:<br>
<br>
1) ActiveRecord::StatementInvalid in 'A new Activation object should &nbsp;<br>
be invalid without a name' Mysql::Error: Table &nbsp;<br>
'cms_production.activations' doesn't exist: SHOW FIELDS FROM &nbsp;<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 &nbsp;<br>
RAILS_ENV to production anywhere, and a rake spec on the command line &nbsp;<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>
&gt; Have you tried to create a /lib/tasks/cruise.rake file, then invoke<br>
&gt; 'spec' task in it?<br>
&gt;<br>
&gt; desc 'Continuous build target'<br>
&gt; task :cruise do<br>
&gt; &nbsp; Rake::Task[&quot;speck&quot;].invoke<br>
&gt; end<br>
&gt;<br>
&gt; CC.rb prefers 'cruise' rake task.<br>
&gt;<br>
&gt; On 4/17/07, Marcus Crafter &lt;marcus@marcuscrafter.com&gt; wrote:<br>
&gt;&gt; Hi All,<br>
&gt;&gt;<br>
&gt;&gt; Hope all is going well.<br>
&gt;&gt;<br>
&gt;&gt; Just installed CC.rb in my development environment here and it
looks<br>
&gt;&gt; great. Top stuff.<br>
&gt;&gt;<br>
&gt;&gt; I was able to get my Rails project registered and building properly<br>
&gt;&gt; which was awesome.<br>
&gt;&gt;<br>
&gt;&gt; I'm using RSpec for my tests rather than Test::Unit, so I modified<br>
&gt;&gt; the project.rake_task to be 'spec' rather than commented out,
however<br>
&gt;&gt; it seems that CC.rb now tries to run my spec's over the production<br>
&gt;&gt; database rather than the test database.<br>
&gt;&gt;<br>
&gt;&gt; Running a 'rake spec' from the command line with the same project<br>
&gt;&gt; works fine as expected, however unfortunately through CC.rb it
fails.<br>
&gt;&gt;<br>
&gt;&gt; Anyone got any thoughts where things might be wrong with the<br>
&gt;&gt; configuration of what database to use? or any pointers where to
take<br>
&gt;&gt; a look?<br>
&gt;&gt;<br>
&gt;&gt; Thanks for any thoughts, ideas.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;<br>
&gt;&gt; Marcus<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Cruisecontrolrb-users mailing list<br>
&gt;&gt; Cruisecontrolrb-users@rubyforge.org<br>
&gt;&gt; http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Jeff Xiong<br>
&gt; Software Journeyman - http://gigix.thoughtworkers.org<br>
&gt; Open Source Contributor - http://cruisecontrolrb.thoughtworks.com/<br>
&gt; Technical Evangelist - http://www.infoq.com/cn/<br>
&gt; _______________________________________________<br>
&gt; Cruisecontrolrb-users mailing list<br>
&gt; Cruisecontrolrb-users@rubyforge.org<br>
&gt; 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>