Add command deprecation module to push

This commit is contained in:
Chris Roberts 2017-02-24 06:23:14 -08:00
parent e2acb5250a
commit 60cd9057a7
2 changed files with 28 additions and 24 deletions

View File

@ -70,6 +70,8 @@ module VagrantPlugins
return name
end
include Vagrant::Util::CommandDeprecation::Complete
end
end
end

View File

@ -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