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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

c++ - Convert big endian to little endian when reading from a binary file -