mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-02-03 20:39:27 -05:00
15 lines
365 B
Ruby
15 lines
365 B
Ruby
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
shared_context "command plugin helpers" do
|
|
def command_lambda(name, result, **opts)
|
|
lambda do
|
|
Class.new(Vagrant.plugin("2", "command")) do
|
|
define_method(:execute) do
|
|
raise opts[:exception] if opts[:exception]
|
|
result
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|