Sha256: 77c1d11e94b7b07ad21cc82c3d8fd72a4ad5295e788490cc90f9b90a895db8a7

Contents?: true

Size: 902 Bytes

Versions: 15

Compression:

Stored size: 902 Bytes

Contents

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

describe VagrantPlugins::CommandPlugin::Action::UpdateGems do
  let(:app) { lambda { |env| } }
  let(:env) {{
    ui: Vagrant::UI::Silent.new
  }}

  let(:manager) { double("manager") }

  subject { described_class.new(app, env) }

  before do
    Vagrant::Plugin::Manager.stub(instance: manager)
    manager.stub(installed_specs: [])
  end

  describe "#call" do
    it "should update all plugins if none are specified" do
      expect(manager).to receive(:update_plugins).with([]).once.and_return([])
      expect(app).to receive(:call).with(env).once
      subject.call(env)
    end

    it "should update specified plugins" do
      expect(manager).to receive(:update_plugins).with(["foo"]).once.and_return([])
      expect(app).to receive(:call).with(env).once

      env[:plugin_name] = ["foo"]
      subject.call(env)
    end
  end
end

Version data entries

15 entries across 12 versions & 4 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.5.2 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.5.1 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.1.2 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/test/unit/plugins/commands/plugin/action/update_gems_test.rb