Occasionally we need to run scripts (such as from cron) that have access to the rails environment. Since we''ve upgraded to 1.1 (I believe it coincides with that), all of our scripts seem to run as unit tests. An example (obviously useless), which would be store in the script directory: ------BEGIN CODE---------------------------- RAILS_ENV = ''development'' require File.dirname(__FILE__) + ''/../config/environment'' score = Score.find(:first) print "Score is: " + score.score.to_s + "\n" ------END CODE------------------------------ Outputs: ------BEGIN OUTPUT---------------------------- Score is: 183945 Loaded suite script/superlatives Started Finished in 0.00114 seconds. 0 tests, 0 assertions, 0 failures, 0 errors ------END OUTPUT------------------------------ Why is the benchmarking/unit test related output coming up? -- Posted via http://www.ruby-forum.com/.
On May 25, 2006, at 11:53 AM, Sean Hermany wrote:> Occasionally we need to run scripts (such as from cron) that have > access > to the rails environment. > > Since we''ve upgraded to 1.1 (I believe it coincides with that), all of > our scripts seem to run as unit tests. > > An example (obviously useless), which would be store in the script > directory: > > ------BEGIN CODE---------------------------- > RAILS_ENV = ''development'' > require File.dirname(__FILE__) + ''/../config/environment'' > > score = Score.find(:first) > > print "Score is: " + score.score.to_s + "\n" > ------END CODE------------------------------ > > Outputs: > ------BEGIN OUTPUT---------------------------- > Score is: 183945 > Loaded suite script/superlatives > Started > > Finished in 0.00114 seconds. > > 0 tests, 0 assertions, 0 failures, 0 errors > ------END OUTPUT------------------------------ > > Why is the benchmarking/unit test related output coming up? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsSean- Thats a very good question. I have just been noticing this myself. Except for me it happens when I run something with script/console. Even if I just try to run script/console ''Post.find :all'' It ouputs the same test unit output you show above. I haven''t been able to figure out why yet. I''ll let you know if I do. -Ezra
On May 25, 2006, at 11:53 AM, Sean Hermany wrote:> Occasionally we need to run scripts (such as from cron) that have > access > to the rails environment. > > Since we''ve upgraded to 1.1 (I believe it coincides with that), all of > our scripts seem to run as unit tests. > > An example (obviously useless), which would be store in the script > directory: > > ------BEGIN CODE---------------------------- > RAILS_ENV = ''development'' > require File.dirname(__FILE__) + ''/../config/environment'' > > score = Score.find(:first) > > print "Score is: " + score.score.to_s + "\n" > ------END CODE------------------------------ > > Outputs: > ------BEGIN OUTPUT---------------------------- > Score is: 183945 > Loaded suite script/superlatives > Started > > Finished in 0.00114 seconds. > > 0 tests, 0 assertions, 0 failures, 0 errors > ------END OUTPUT------------------------------ > > Why is the benchmarking/unit test related output coming up? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsSean- I actually just figured out that the file_column plugin was making this happen. For some reason just having the file_column plugin in vendor/plugins was making the test unit output happen. I moved the file_column dir out of the project temporarily and the problem went away. So are you running file_columnn? ;) -Ezra
The only plugin I''m using for this particular project is tzinfo_timezone, which I highly doubt would be causing this behavior (but then, I don''t know what''s causing this behavior, so who am I to say). Ezra Zygmuntowicz wrote:> Sean- > > I actually just figured out that the file_column plugin was making > this happen. For some reason just having the file_column plugin in > vendor/plugins was making the test unit output happen. I moved the > file_column dir out of the project temporarily and the problem went > away. So are you running file_columnn? ;) > > -Ezra-- Posted via http://www.ruby-forum.com/.