Running/debugging specs/tests with RAILS_ENV=test


Is it possible to specify that whenever I run something called *.spec it should set the RAILS_ENV to test?

Nicholas F

Comment actions Permalink

Yes,you can change default settings for new RSpec run configurations - go to  "Run | Edit Configurations | Edit Defaults | RSpec" and set RAILS_ENV environment variables (click on "..." button near "Environment Variables" text field). After these settings will be applied for all new RSpec run configurations. Also we can improve our settings and by default add this environment variable to all new rspec/test::unit run configurations for rails project

Comment actions Permalink

Update: In the next EAP RubyMine will automatically add RAILS_ENV=test variable to new spec/test::unit run configurations if value of this env variable isn't overridden default configurations  settings.

Comment actions Permalink

Brilliant - it *just works* wins everytime.

Thanks Roman.


Please sign in to leave a comment.