Sha256: 9561374b44f2ed678dc5c7d7a4f10ccb3ad740032e3203fb9f1554adf7b2e90f

Contents?: true

Size: 1.54 KB

Versions: 19

Compression:

Stored size: 1.54 KB

Contents

require File.expand_path("../../base", __FILE__)

describe Vagrant::Config do
  it "should not execute the proc on configuration" do
    described_class.run do
      raise Exception, "Failure."
    end
  end

  it "should capture calls to `Vagrant.configure`" 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()

    procs = described_class.capture_configures do
      described_class.run do
        receiver.hello!
      end
    end

    # Verify the structure of the result
    procs.should be_kind_of(Array)
    procs.length.should == 1

    # Verify that the proper proc was captured
    receiver.should_receive(:hello!).once
    procs[0][0].should == "1"
    procs[0][1].call
  end

  it "should capture the proper version" do
    procs = described_class.capture_configures do
      described_class.run("1") {}
      described_class.run("2") {}
    end

    # Verify the structure of the result
    procs.should be_kind_of(Array)
    procs.length.should == 2
    procs[0][0].should == "1"
    procs[1][0].should == "2"
  end
end

Version data entries

19 entries across 19 versions & 6 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/test/unit/vagrant/config_test.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/test/unit/vagrant/config_test.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/test/unit/vagrant/config_test.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/test/unit/vagrant/config_test.rb
tnargav-1.3.6 test/unit/vagrant/config_test.rb
tnargav-1.3.3 test/unit/vagrant/config_test.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/unit/vagrant/config_test.rb
tnargav-1.2.3 test/unit/vagrant/config_test.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/unit/vagrant/config_test.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/test/unit/vagrant/config_test.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/test/unit/vagrant/config_test.rb
tnargav-1.2.2 test/unit/vagrant/config_test.rb
vagrantup-1.1.3 test/unit/vagrant/config_test.rb
vagrantup-1.1.2 test/unit/vagrant/config_test.rb
vagrantup-1.1.1 test/unit/vagrant/config_test.rb
vagrantup-1.1.0 test/unit/vagrant/config_test.rb
vagrantup-1.1.4 test/unit/vagrant/config_test.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/test/unit/vagrant/config_test.rb
vagrant-lxc-0.0.1 vendor/vagrant/test/unit/vagrant/config_test.rb