diff --git a/plugins/commands/serve/mappers/machine.rb b/plugins/commands/serve/mappers/machine.rb index d76579ce9..46f2951a6 100644 --- a/plugins/commands/serve/mappers/machine.rb +++ b/plugins/commands/serve/mappers/machine.rb @@ -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 diff --git a/test/unit/plugins/commands/serve/mappers_test.rb b/test/unit/plugins/commands/serve/mappers_test.rb index 951bfb381..9ef890db8 100644 --- a/test/unit/plugins/commands/serve/mappers_test.rb +++ b/test/unit/plugins/commands/serve/mappers_test.rb @@ -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