Sha256: b6ae3697ec5c09c325a28e3fb096e0f87fb7a4367e41e04e4cac4438825c0e5a

Contents?: true

Size: 695 Bytes

Versions: 4

Compression:

Stored size: 695 Bytes

Contents

require "spec_helper"

gem_path = "/opt/chef/embedded/bin/gem"
white_list = %w{chef-config json rake}

describe "gem list" do
  it "should not have non-whitelisted duplicate gems" do
    gems = command("#{gem_path} list").stdout

    duplicate_gems = gems.lines().select { |l| l.include?(",") }.collect { |l| l.split(" ").first }
    puts "Duplicate gems found: #{duplicate_gems}" if duplicate_gems.length > 0

    non_whitelisted_duplicates = duplicate_gems.select { |l| !white_list.include?(l) }
    puts "Non white listed duplicates: #{non_whitelisted_duplicates}" if non_whitelisted_duplicates.length > 0

    (non_whitelisted_duplicates.length).should be == 0
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chef-12.22.1 acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb
chef-12.22.1-universal-mingw32 acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb
chef-12.8.1 acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb
chef-12.8.1-universal-mingw32 acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb