diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-04-04 11:26:27 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-04-04 12:50:43 -0700 |
commit | 95571e8f9238db21c9b6be0334d5d29065844b17 (patch) | |
tree | a0e9b620a1900e27e5fc3d4b6735586734cb00bb /spec/unit/cookbook | |
parent | 467499fbbbd3a29bdee2b171655f0d5f441e531e (diff) | |
download | chef-95571e8f9238db21c9b6be0334d5d29065844b17.tar.gz |
add better specs around modifying gem sources
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/cookbook')
-rw-r--r-- | spec/unit/cookbook/gem_installer_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/cookbook/gem_installer_spec.rb b/spec/unit/cookbook/gem_installer_spec.rb index 69b714d977..91e6959331 100644 --- a/spec/unit/cookbook/gem_installer_spec.rb +++ b/spec/unit/cookbook/gem_installer_spec.rb @@ -67,4 +67,19 @@ describe Chef::Cookbook::GemInstaller do expect(bundler_dsl.dependencies.find { |d| d.name == "httpclient" }.requirements_list.length).to eql(2) end + + it "generates a valid Gemfile when Chef::Config[:rubygems_url] is set to a String" do + Chef::Config[:rubygems_url] = "https://www.rubygems.org" + expect { gem_installer.install }.to_not raise_error + + expect(bundler_dsl.dependencies.find { |d| d.name == "httpclient" }.requirements_list.length).to eql(2) + end + + it "generates a valid Gemfile when Chef::Config[:rubygems_url] is set to an Array" do + Chef::Config[:rubygems_url] = [ "https://www.rubygems.org" ] + + expect { gem_installer.install }.to_not raise_error + + expect(bundler_dsl.dependencies.find { |d| d.name == "httpclient" }.requirements_list.length).to eql(2) + end end |