Add basic create_trigger rspec test

This commit is contained in:
Brian Cain 2018-03-19 16:33:06 -07:00
parent e157362ace
commit fc526a164a
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 17 additions and 0 deletions

View File

@ -135,4 +135,21 @@ describe VagrantPlugins::Kernel_V2::TriggerConfig do
expect(af_trigger.size).to eq(3)
end
end
describe "#create_trigger" do
let(:command) { :up }
let(:hash_block) { {info: "hi", run: {inline: "echo 'hi'"}} }
it "returns a new VagrantConfigTrigger object if given a hash" do
trigger = subject.create_trigger(command, hash_block)
expect(trigger).to be_a(VagrantPlugins::Kernel_V2::VagrantConfigTrigger)
end
it "returns a new VagrantConfigTrigger object if given a block" do
block = Proc.new { |b| b.info = "test"}
trigger = subject.create_trigger(command, block)
expect(trigger).to be_a(VagrantPlugins::Kernel_V2::VagrantConfigTrigger)
end
end
end