Sha256: 710c762b242ca412963940c306b2add89b7134b62583bce33df3e08b1bca9945

Contents?: true

Size: 1.09 KB

Versions: 22

Compression:

Stored size: 1.09 KB

Contents

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

require Vagrant.source_root.join("plugins/commands/list-commands/command")

describe VagrantPlugins::CommandListCommands::Command do
  include_context "unit"
  include_context "command plugin helpers"

  let(:iso_env) do
    # We have to create a Vagrantfile so there is a root path
    env = isolated_environment
    env.vagrantfile("")
    env.create_vagrant_env
  end

  let(:argv)     { [] }
  let(:commands) { {} }

  subject { described_class.new(argv, iso_env) }

  before do
    Vagrant.plugin("2").manager.stub(commands: commands)
  end

  describe "execute" do
    it "includes all subcommands" do
      commands[:foo] = [command_lambda("foo", 0), { primary: true }]
      commands[:bar] = [command_lambda("bar", 0), { primary: true }]
      commands[:baz] = [command_lambda("baz", 0), { primary: false }]

      expect(iso_env.ui).to receive(:info).with { |message, opts|
        expect(message).to include("foo")
        expect(message).to include("bar")
        expect(message).to include("baz")
      }

      subject.execute
    end
  end
end

Version data entries

22 entries across 19 versions & 5 rubygems

Version Path
vagrant-unbundled-1.9.7.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.9.5.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.9.1.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.5.2 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.5.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.1.2 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/commands/list-commands/command_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/test/unit/plugins/commands/list-commands/command_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/test/unit/plugins/commands/list-commands/command_test.rb