2014-01-11 17:32:13 +00:00
|
|
|
shared_context "command plugin helpers" do
|
2014-01-14 05:42:40 +00:00
|
|
|
def command_lambda(name, result, **opts)
|
2014-01-11 17:32:13 +00:00
|
|
|
lambda do
|
|
|
|
Class.new(Vagrant.plugin("2", "command")) do
|
|
|
|
define_method(:execute) do
|
2014-01-14 05:42:40 +00:00
|
|
|
raise opts[:exception] if opts[:exception]
|
2014-01-11 17:32:13 +00:00
|
|
|
result
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|