core: configure version can be an int [GH-2689]
This commit is contained in:
parent
151ea86004
commit
4d7d47086f
|
@ -1,6 +1,8 @@
|
|||
## 1.4.2 (unreleased)
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
- core: The version for `Vagrant.configure` can now be an int. [GH-2689]
|
||||
|
||||
## 1.4.1 (December 18, 2013)
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ module Vagrant
|
|||
def self.run(version="1", &block)
|
||||
# Store it for later
|
||||
@last_procs ||= []
|
||||
@last_procs << [version, block]
|
||||
@last_procs << [version.to_s, block]
|
||||
end
|
||||
|
||||
# This is a method which will yield to a block and will capture all
|
||||
|
|
|
@ -32,6 +32,31 @@ describe Vagrant::Config do
|
|||
procs[1][1].call
|
||||
end
|
||||
|
||||
it "should work with integer configurations "do
|
||||
receiver = double()
|
||||
|
||||
procs = described_class.capture_configures do
|
||||
Vagrant.configure(1) do
|
||||
receiver.one
|
||||
end
|
||||
|
||||
Vagrant.configure(2) do
|
||||
receiver.two
|
||||
end
|
||||
end
|
||||
|
||||
procs.should be_kind_of(Array)
|
||||
procs.length.should == 2
|
||||
procs[0][0].should == "1"
|
||||
procs[1][0].should == "2"
|
||||
|
||||
# Verify the proper procs were captured
|
||||
receiver.should_receive(:one).once.ordered
|
||||
receiver.should_receive(:two).once.ordered
|
||||
procs[0][1].call
|
||||
procs[1][1].call
|
||||
end
|
||||
|
||||
it "should capture configuration procs" do
|
||||
receiver = double()
|
||||
|
||||
|
|
Loading…
Reference in New Issue