-
Notifications
You must be signed in to change notification settings - Fork 240
Warning: no environment
Cezary Baginski edited this page Jul 10, 2015
·
2 revisions
If you're using Zeus, you need a custom plan to save/pass configuration variables (see: https://github.com/burke/zeus/issues/523).
Create a custom Zeus plan to silence the warning:
-
Run
zeus init
-
Edit
custom_plan.rb
to contain the following:
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def test(*args)
ENV['GUARD_RSPEC_RESULTS_FILE'] = 'tmp/guard_rspec_results.txt' # can be anything matching Guard::RSpec :results_file option in the Guardfile
super
end
end
Zeus.plan = CustomPlan.new
-
Restart the
zeus server
(so it can reload the custom plan) -
Fool Guard::RSpec into thinking it's config is being honored by setting a matching results file in the
Guardfile
:
rspec_options = {
results_file: 'tmp/guard_rspec_results.txt', # << add this option to match above path in custom_plan.rb
cmd: "zeus rspec",
all_after_pass: true,
failed_mode: :focus
}
guard :rspec, rspec_options do
# (...)