Unverified Commit f8f1b178 by Andrew W. Lee Committed by GitHub

Refactor Parser (#641)

Refactored Parser to isolate changes being made to ENV. This way we have an intermediate step where we know the environment variables being set.
parent 574cc61b
...@@ -345,9 +345,9 @@ module Annotate # rubocop:disable Metrics/ModuleLength ...@@ -345,9 +345,9 @@ module Annotate # rubocop:disable Metrics/ModuleLength
context "when ENV['require'] is already set" do context "when ENV['require'] is already set" do
let(:preset_require_value) { 'some_dir/' } let(:preset_require_value) { 'some_dir/' }
it "appends the path to ENV['require']" do it "appends the path to ENV['require']" do
allow(ENV).to receive(:[]).and_return(preset_require_value) env = { 'require' => preset_require_value }
expect(ENV).to receive(:[]=).with(env_key, "#{preset_require_value},#{set_value}") expect(ENV).to receive(:[]=).with(env_key, "#{preset_require_value},#{set_value}")
Parser.parse([option, set_value]) Parser.parse([option, set_value], env)
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment