On Fri, Mar 27, 2009 at 4:50 PM, Tadatoshi T.
[email protected] wrote:
About Steve’s comment,
I may not be familiar with everything in Ruby on Rails but I am willing
to learn.
FWIW, I absolutely did not mean my comment as an insult, to you or
anybody else. I was going a bit more general, and wasn’t referring
specifically to you. Anyway, in my own head “new user” is never an
insult. Everybody starts there. It’s like insulting someone for
having been born.
And I would like to know in which case it would be better to run RSpec
in an environment other than test one.
I can see cases where some specialized behaviors might run in specific
environments – for instance, maybe you have a routine task in your
staging environment that copies data from the production environment,
etc. If those behaviors are non-trivial, it makes sense to spec and
test them. But if they’re initialized in your environment config
files, you’re then stuck either with doing backflips to try to fake
out Rails, or running your specs in that environment.
That’s just one hypothetical case off the top of my head. Doubtless
there are others that might be logical. (And a whole lot more that
wouldn’t be, but someone would surely try them anyway.)
To me, I like clear separation of development, test, and production
environment in Ruby on Rails.
And I like to run Specs in test environment because for every run of a
spec (example), database is cleaned up and doesn’t affect the result of
running the next spec (example). And I don’t want the development
database to be cleaned up by running RSpec against it.
And you’re absolutely right. On all of that. Anything different
would be an exception, not the rule. It sounds to me like you’re
pretty grounded in the principles of Rails – don’t sell yourself
short.
–
Have Fun,
Steve E. ([email protected])
ESCAPE POD - The Science Fiction Podcast Magazine
http://www.escapepod.org