Make pacman-the-package-provider able to install package from source#107
Make pacman-the-package-provider able to install package from source#1075long wants to merge 8 commits intopuppetlabs:masterfrom
Conversation
There was a problem hiding this comment.
This would probably be much clearer as something like the following, since you should be able to assign the source here, rather than having to stub things.
@resource[:source] = sourceThere was a problem hiding this comment.
No it breaks the tests unfortunately.
There was a problem hiding this comment.
Right. I hadn't noticed that it was a stub resource instead of a real one when looking at the diff.
There was a problem hiding this comment.
With the following change, it works as I was expecting (with all tests passing):
diff --git i/spec/unit/provider/package/pacman_spec.rb w/spec/unit/provider/package/pacman_spec.rb
index 7e2789a..721c230 100644
--- i/spec/unit/provider/package/pacman_spec.rb
+++ w/spec/unit/provider/package/pacman_spec.rb
@@ -6,10 +6,7 @@ provider = Puppet::Type.type(:package).provider(:pacman)
describe provider do
before do
provider.stubs(:command).with(:pacman).returns('/usr/bin/pacman')
- @resource = stub 'resource'
- @resource.stubs(:[]).with(:name).returns("package")
- @resource.stubs(:[]).with(:source).returns(nil)
- @resource.stubs(:name).returns("name")
+ @resource = Puppet::Type.type(:package).new(:name => 'package')
@provider = provider.new(@resource)
end
@@ -69,7 +66,7 @@ describe provider do
ftp://some.package.in/the/air
}.each do |source|
it "should install #{source} directly" do
- @resource.stubs(:[]).with(:source).returns source
+ @resource[:source] = source
db = states("db").starts_as(:not_synced)
provider.expects(:execute).|
I squashed down things a bit further, and split up the state machine -> sequence change into a squashed commit, and one of its own for part of it. Everything was merged into master in d2b4c85. Thanks for working on this! |
(maint) Update horsewhisperer; show only global help
pacman -Ucould be used to install package from a local file or a URL and here it goes.CLA signed as: https://projects.puppetlabs.com/users/3462