From ca232444e75fd992435670a9c685fdeee7fe9e0b Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 6 May 2019 11:09:34 -0700 Subject: [PATCH] Separate snapshot names when listing snapshots Prior to this commit, Vagrant would list all machine snapshots in a flat list, without showing which snapshots were associated with which guests. This commit fixes that by placing some separation to make it clear which snapshots belong to which guests. --- plugins/commands/snapshot/command/list.rb | 3 ++- test/unit/plugins/commands/snapshot/command/list_test.rb | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/commands/snapshot/command/list.rb b/plugins/commands/snapshot/command/list.rb index 1ee77aac4..32f5dcb0f 100644 --- a/plugins/commands/snapshot/command/list.rb +++ b/plugins/commands/snapshot/command/list.rb @@ -32,8 +32,9 @@ module VagrantPlugins next end + vm.ui.output("", prefix: true) snapshots.each do |snapshot| - vm.ui.output(snapshot, prefix: false) + vm.ui.detail(snapshot, prefix: false) end end diff --git a/test/unit/plugins/commands/snapshot/command/list_test.rb b/test/unit/plugins/commands/snapshot/command/list_test.rb index ea6412356..0b59eba2a 100644 --- a/test/unit/plugins/commands/snapshot/command/list_test.rb +++ b/test/unit/plugins/commands/snapshot/command/list_test.rb @@ -72,9 +72,10 @@ describe VagrantPlugins::CommandSnapshot::Command::List do allow(machine.provider).to receive(:capability).with(:snapshot_list). and_return(["foo", "bar", "baz"]) - expect(iso_env.ui).to receive(:output).with(/foo/, anything) - expect(iso_env.ui).to receive(:output).with(/bar/, anything) - expect(iso_env.ui).to receive(:output).with(/baz/, anything) + expect(iso_env.ui).to receive(:output).with(/default/, anything) + expect(iso_env.ui).to receive(:detail).with(/foo/, anything) + expect(iso_env.ui).to receive(:detail).with(/bar/, anything) + expect(iso_env.ui).to receive(:detail).with(/baz/, anything) expect(subject.execute).to eq(0) end end