ruby on rails - How can I change environment variables using guard with Rspec -


i'm using rspec , guard test rails app.

it's working well, have tags ignored if there's no environment variable set.

for example:

rspec.configure |config|   config.use_transactional_fixtures = false    config.include factorygirl::syntax::methods    config.treat_symbols_as_metadata_keys_with_true_values = true   config.filter_run focus: true   config.run_all_when_everything_filtered = true    config.filter_run_excluding :slow unless env["slow_specs"] end 

so specs marked :slow run when slow_specs=1 in environment

how can change value without having restart guard?

assuming you're using guard-rspec run specs, can pass in environmental variable using cmd option, example:

guard :rspec, cmd: 'slow_specs=false spring rspec' ... 

and updating rspec configuration include:

config.filter_run_excluding :slow unless env["slow_specs"] == "1"