Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting an environment variable when running default Debug command in Rubymine

I have feature specs in my Rails app that use Capybara to run tests through a browser. By default they use the phantomjs/poltergeist and rack-test drivers, which are headless.

It often is desirable to run a single spec (or spec file) using a capybara driver that runs a visible browser so that I can see what is happening. For this use case I use Selenium. When I want to run a spec using Selenium I set an environment variable (DEBUG=true) before running rspec like so:

DEBUG=true rspec spec/features/my_spec.rb

My spec_helper looks for the DEBUG environment variable and runs the spec with Selenium instead of the default drivers. I'd like to duplicate this capability in Rubymine, so that when I right-click on a spec in the project tree and click "Debug 'Run spec...'" it sets up the DEBUG environment variable and runs the spec with the Selenium driver. How can I configure the default 'Debug' configuration to set up this environment variable?

like image 411
Jeff Perrin Avatar asked Dec 19 '13 05:12

Jeff Perrin


1 Answers

Next to the run button on the tool bar, there's the name of the configuration that is active, click it and choose Edit Configuration inside you'll find server arguments you can write there the DEBUG=true and it will be sent to the runner file.

Location of configuration

like image 113
Mohammad AbuShady Avatar answered Nov 02 '22 09:11

Mohammad AbuShady