diff --git a/test/unit/vagrant/action/builtin/is_env_set_test.rb b/test/unit/vagrant/action/builtin/is_env_set_test.rb new file mode 100644 index 000000000..56eafa956 --- /dev/null +++ b/test/unit/vagrant/action/builtin/is_env_set_test.rb @@ -0,0 +1,31 @@ +require "pathname" +require "tmpdir" + +require File.expand_path("../../../../base", __FILE__) + +describe Vagrant::Action::Builtin::IsEnvSet do + let(:app) { lambda { |env| } } + let(:env) { { } } + + describe "#call" do + it "sets result to true if it is set" do + env[:bar] = true + + subject = described_class.new(app, env, :bar) + + expect(app).to receive(:call).with(env) + + subject.call(env) + expect(env[:result]).to be_true + end + + it "sets result to false if it isn't set" do + subject = described_class.new(app, env, :bar) + + expect(app).to receive(:call).with(env) + + subject.call(env) + expect(env[:result]).to be_false + end + end +end