Skip to content

Commit

Permalink
Set provisioner names to symbol
Browse files Browse the repository at this point in the history
Because Vagrant is handling provisioner names to be symbols more
uniformly now, update the mocked tests to reflect this change. Otherwise
these provisioners will be ignored and not run.
  • Loading branch information
briancain committed Jan 6, 2020
1 parent b4c302a commit ee8b38d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/unit/vagrant/action/builtin/provision_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@
end

it "should not run if provision types are set and provisioner is not included" do
env[:provision_types] = ["other-provisioner", "other-test"]
env[:provision_types] = [:"other-provisioner", :"other-test"]
expect(hook).not_to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end

it "should run if provision types are set and include provisioner name" do
env[:provision_types] = ["spec-test"]
env[:provision_types] = [:"spec-test"]
expect(hook).to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end
Expand Down Expand Up @@ -142,13 +142,13 @@
end

it "should not run if provision types are set and provisioner is not included" do
env[:provision_types] = ["other-provisioner", "other-test"]
env[:provision_types] = [:"other-provisioner", :"other-test"]
expect(hook).not_to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end

it "should run if provision types are set and include provisioner name" do
env[:provision_types] = ["spec-test"]
env[:provision_types] = [:"spec-test"]
expect(hook).to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end
Expand Down Expand Up @@ -177,13 +177,13 @@
end

it "should not run if provision types are set and provisioner is not included" do
env[:provision_types] = ["other-provisioner", "other-test"]
env[:provision_types] = [:"other-provisioner", :"other-test"]
expect(hook).not_to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end

it "should run if provision types are set and include provisioner name" do
env[:provision_types] = ["spec-test"]
env[:provision_types] = [:"spec-test"]
expect(hook).to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end
Expand All @@ -192,7 +192,7 @@
File.open(File.join(data_dir.to_s, "action_provision"), "w") do |file|
file.write("1.5:machine-id")
end
env[:provision_types] = ["spec-test"]
env[:provision_types] = [:"spec-test"]
expect(hook).to receive(:call).with(:provisioner_run, anything)
instance.call(env)
end
Expand Down

0 comments on commit ee8b38d

Please sign in to comment.