Sha256: 456d75a408946e124c4e757cfa5c4bcb16adba9afbb5a2e272eabffd787d1aec

Contents?: true

Size: 1.09 KB

Versions: 59

Compression:

Stored size: 1.09 KB

Contents

# This is a shared example that tests that a command requires a
# Vagrant environment to run properly. The exact command to run
# should be given as a parameter to the shared examples.
shared_examples "a command that requires a Vagrantfile" do |*args|
  let(:command) do
    raise ArgumentError, "A command must be set for the shared example." if args.empty?
    args[0]
  end

  it "fails if no Vagrantfile is found" do
    result = execute(*command)
    result.should_not succeed
    result.stderr.should match_output(:no_vagrantfile)
  end
end

# This is a shared example that tests that the command requires a
# virtual machine to be created, and additionally to be in one of
# many states.
shared_examples "a command that requires a virtual machine" do |*args|
  let(:command) do
    raise ArgumentError, "A command must be set for the shared example." if args.empty?
    args[0]
  end

  it "fails if the virtual machine is not created" do
    assert_execute("vagrant", "init")

    result = execute(*command)
    result.should_not succeed
    result.stderr.should match_output(:error_vm_must_be_created)
  end
end

Version data entries

59 entries across 59 versions & 11 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/test/acceptance/support/shared/command_examples.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/test/acceptance/support/shared/command_examples.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/support/shared/command_examples.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/support/shared/command_examples.rb
bmhatfield-vagrant-1.0.10 test/acceptance/support/shared/command_examples.rb
bmhatfield-vagrant-1.0.9 test/acceptance/support/shared/command_examples.rb
tnargav-1.3.6 test/acceptance/support/shared/command_examples.rb
tnargav-1.3.3 test/acceptance/support/shared/command_examples.rb
bmhatfield-vagrant-1.0.8 test/acceptance/support/shared/command_examples.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/support/shared/command_examples.rb
tnargav-1.2.3 test/acceptance/support/shared/command_examples.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/support/shared/command_examples.rb
bmhatfield-vagrant-1.0.7 test/acceptance/support/shared/command_examples.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/support/shared/command_examples.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/support/shared/command_examples.rb
tnargav-1.2.2 test/acceptance/support/shared/command_examples.rb
vagrantup-1.1.3 test/acceptance/support/shared/command_examples.rb
vagrantup-1.1.2 test/acceptance/support/shared/command_examples.rb
vagrantup-1.1.1 test/acceptance/support/shared/command_examples.rb
vagrantup-1.1.0 test/acceptance/support/shared/command_examples.rb