Sha256: 840931155a8376d55a692be56ffea82da1620ed0695a76c95e7bce3c6c38e254

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

require "vagrant-spec/acceptance/output"

module Vagrant
  module Spec
    # Default plugins within plugin list when run mode
    # is set as "plugin"
    DEFAULT_PLUGINS = ["vagrant-share".freeze].freeze

    # Tests the Vagrant plugin list output has no plugins
    OutputTester[:plugin_list_none] = lambda do |text|
      if Vagrant::Spec::Acceptance.config.run_mode == "plugin"
        valid = DEFAULT_PLUGINS.all? do |plugin_name|
          text.include?(plugin_name)
        end
        if valid
          valid = !text.lines.any? do |line|
            !line.start_with?(" ") &&
              !DEFAULT_PLUGINS.include?(line.split(/\s/).first)
          end
        end
        valid
      else
        text =~ /^No plugins/
      end
    end

    # Tests that plugin list shows a plugin
    OutputTester[:plugin_list_plugin] = lambda do |text, name, version|
      text =~ /^#{name} \(#{version}\)$/
    end

    # Tests that Vagrant plugin install fails to a plugin not found
    OutputTester[:plugin_install_not_found] = lambda do |text, name|
      text =~ /Unable to resolve dependency:.* '#{name}/
    end

    # Tests that Vagrant plugin install fails to a plugin not found
    OutputTester[:plugin_installed] = lambda do |text, name, version|
      text =~ /^Installed the plugin '#{name} \(#{version}\)'/
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-1d09951eaef3/acceptance/output/plugin_output.rb