Add command deprecation module to push
This commit is contained in:
parent
e2acb5250a
commit
60cd9057a7
|
@ -70,6 +70,8 @@ module VagrantPlugins
|
|||
|
||||
return name
|
||||
end
|
||||
|
||||
include Vagrant::Util::CommandDeprecation::Complete
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue