Sha256: 16ba1ff6b20548ab2c24846bf34db6cdc9d403fcd029c8cb4e0efe219bcd9ef3

Contents?: true

Size: 1.07 KB

Versions: 17

Compression:

Stored size: 1.07 KB

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
    allow(Vagrant::Plugin::Manager).to receive(:instance).and_return(manager)
    allow(manager).to receive(:installed_specs).and_return([])
  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(manager).to receive(:installed_plugins).twice.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(manager).to receive(:installed_plugins).twice.and_return({})
      expect(app).to receive(:call).with(env).once

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

Version data entries

17 entries across 13 versions & 5 rubygems

Version Path
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-2.0.2.0 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-2.0.1.0 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-2.0.0.1 test/unit/plugins/commands/plugin/action/update_gems_test.rb
vagrant-unbundled-1.9.8.1 test/unit/plugins/commands/plugin/action/update_gems_test.rb