Fix MachineState mapper so IsRunning actions work
The IsRunning action checks if `env[:machine].state.id == :running` but this check was never passing as the protobuf-washed version of machine state was yielding a machine state w/ a string value like `"running"`. Easy fix in the mapper!
This commit is contained in:
parent
a5f0996f5f
commit
8730b9f100
@ -116,7 +116,7 @@ module VagrantPlugins
|
||||
|
||||
def converter(m)
|
||||
Vagrant::MachineState.new(
|
||||
m.id, m.short_description, m.long_description
|
||||
m.id.to_sym, m.short_description, m.long_description
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@ -36,4 +36,15 @@ describe VagrantPlugins::CommandServe::Mappers do
|
||||
expect(output).to eq([false])
|
||||
end
|
||||
end
|
||||
|
||||
context "MachineState" do
|
||||
it "yields an id that's a symbol, not a string" do
|
||||
input = Hashicorp::Vagrant::Sdk::Args::Target::Machine::State.new(
|
||||
id: "running",
|
||||
)
|
||||
output = subject.map(input, to: Vagrant::MachineState)
|
||||
|
||||
expect(output.id).to eq(:running)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user