From 60cd9057a73c0c0ba8db1423d6db6c7b9d361901 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 24 Feb 2017 06:23:14 -0800 Subject: [PATCH] Add command deprecation module to push --- plugins/commands/push/command.rb | 2 + .../plugins/commands/push/command_test.rb | 50 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/plugins/commands/push/command.rb b/plugins/commands/push/command.rb index 902a0c946..0b1793bcb 100644 --- a/plugins/commands/push/command.rb +++ b/plugins/commands/push/command.rb @@ -70,6 +70,8 @@ module VagrantPlugins return name end + + include Vagrant::Util::CommandDeprecation::Complete end end end diff --git a/test/unit/plugins/commands/push/command_test.rb b/test/unit/plugins/commands/push/command_test.rb index a97f4caba..923a39e12 100644 --- a/test/unit/plugins/commands/push/command_test.rb +++ b/test/unit/plugins/commands/push/command_test.rb @@ -33,35 +33,37 @@ describe VagrantPlugins::CommandPush::Command do allow(env).to receive(:push) end - it "validates the pushes" do - expect(subject).to receive(:validate_pushes!).once - subject.execute - end + # NOTE: Disabled due to deprecation + # + # it "validates the pushes" do + # expect(subject).to receive(:validate_pushes!).once + # subject.execute + # end - it "delegates to Environment#push" do - expect(env).to receive(:push).once - subject.execute - end + # it "delegates to Environment#push" do + # expect(env).to receive(:push).once + # subject.execute + # end - it "validates the configuration" do - iso_env.vagrantfile <<-EOH - Vagrant.configure("2") do |config| - config.vm.box = "hashicorp/precise64" + # it "validates the configuration" do + # iso_env.vagrantfile <<-EOH + # Vagrant.configure("2") do |config| + # config.vm.box = "hashicorp/precise64" - config.push.define "noop" do |push| - push.bad = "ham" - end - end - EOH + # config.push.define "noop" do |push| + # push.bad = "ham" + # end + # end + # EOH - subject = described_class.new(argv, iso_env.create_vagrant_env) - allow(subject).to receive(:validate_pushes!) - .and_return(:noop) + # subject = described_class.new(argv, iso_env.create_vagrant_env) + # allow(subject).to receive(:validate_pushes!) + # .and_return(:noop) - expect { subject.execute }.to raise_error(Vagrant::Errors::ConfigInvalid) { |err| - expect(err.message).to include("The following settings shouldn't exist: bad") - } - end + # expect { subject.execute }.to raise_error(Vagrant::Errors::ConfigInvalid) { |err| + # expect(err.message).to include("The following settings shouldn't exist: bad") + # } + # end end describe "#validate_pushes!" do