Forum: Ruby on Rails Behavior Change in Scripts since 1.1?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sean H. (Guest)
on 2006-05-25 22:53
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?
Ezra Z. (Guest)
on 2006-05-26 00:13
(Received via mailing list)
On May 25, 2006, at 11:53 AM, Sean Hermany wrote:

> ------BEGIN CODE----------------------------
> Score is: 183945
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails


Sean-

	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
Ezra Z. (Guest)
on 2006-05-26 00:20
(Received via mailing list)
On May 25, 2006, at 11:53 AM, Sean Hermany wrote:

> ------BEGIN CODE----------------------------
> Score is: 183945
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

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
Sean H. (Guest)
on 2006-05-26 00:25
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 Z. 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
This topic is locked and can not be replied to.