Skip to content

Commit

Permalink
Merge branch 'juniorz-patch-1'
Browse files Browse the repository at this point in the history
* juniorz-patch-1:
  (#19663) Remove --include-dependencies flag in gem package provider

closes puppetlabs#1517
  • Loading branch information
Jeff McCune committed Mar 8, 2013
2 parents 7e3d491 + 2284e83 commit c07f0a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 0 additions & 2 deletions lib/puppet/provider/package/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def self.instances(justme = false)
def install(useversion = true)
command = [command(:gemcmd), "install"]
command << "-v" << resource[:ensure] if (! resource[:ensure].is_a? Symbol) and useversion
# Always include dependencies
command << "--include-dependencies"

if source = resource[:source]
begin
Expand Down
17 changes: 6 additions & 11 deletions spec/unit/provider/package/gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,33 @@
provider.install
end

it "should specify that dependencies should be included" do
provider.expects(:execute).with { |args| args[2] == "--include-dependencies" }.returns ""
provider.install
end

it "should specify that documentation should not be included" do
provider.expects(:execute).with { |args| args[3] == "--no-rdoc" }.returns ""
provider.expects(:execute).with { |args| args[2] == "--no-rdoc" }.returns ""
provider.install
end

it "should specify that RI should not be included" do
provider.expects(:execute).with { |args| args[4] == "--no-ri" }.returns ""
provider.expects(:execute).with { |args| args[3] == "--no-ri" }.returns ""
provider.install
end

it "should specify the package name" do
provider.expects(:execute).with { |args| args[5] == "myresource" }.returns ""
provider.expects(:execute).with { |args| args[4] == "myresource" }.returns ""
provider.install
end

describe "when a source is specified" do
describe "as a normal file" do
it "should use the file name instead of the gem name" do
resource[:source] = "/my/file"
provider.expects(:execute).with { |args| args[3] == "/my/file" }.returns ""
provider.expects(:execute).with { |args| args[2] == "/my/file" }.returns ""
provider.install
end
end
describe "as a file url" do
it "should use the file name instead of the gem name" do
resource[:source] = "file:///my/file"
provider.expects(:execute).with { |args| args[3] == "/my/file" }.returns ""
provider.expects(:execute).with { |args| args[2] == "/my/file" }.returns ""
provider.install
end
end
Expand All @@ -73,7 +68,7 @@
describe "as a non-file and non-puppet url" do
it "should treat the source as a gem repository" do
resource[:source] = "http://host/my/file"
provider.expects(:execute).with { |args| args[3..5] == ["--source", "http://host/my/file", "myresource"] }.returns ""
provider.expects(:execute).with { |args| args[2..4] == ["--source", "http://host/my/file", "myresource"] }.returns ""
provider.install
end
end
Expand Down

0 comments on commit c07f0a9

Please sign in to comment.