ruby on rails - Check on TEST mode during runtime -


my web application writes kind of log during runtime. don't want write log when running test suite using cucumber.

so, how can check current runtime environment (test, dev or prod)?

i'm looking c equivalent i.e. :
#ifdef debug
   // run in debug mode
#endif

thank helping me on this.

try if condition:

if env['rails_env'] == "test"     # insert code here end 

(replace 'test' 'development' or 'production' needed)


Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -