-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub the correct provider rather than the query
- Loading branch information
1 parent
a101a2c
commit 6ce24fb
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,7 +286,9 @@ def self.it_should_respond_to(*actions) | |
|
||
it "should install specific version(2)" do | ||
resource[:ensure] = '0.0.8' | ||
expect(provider).to receive(:query).with(no_args).and_return({:ensure => '0.0.7,5.11-0.151006:20131230T130000Z'}).exactly(2).times | ||
expect(Puppet::Util::Execution).to receive(:execute) | ||
.with(['/bin/pkg', 'list', '-Hv', 'dummy'], {:failonfail => false, :combine => true}) | ||
.and_return(Puppet::Util::Execution::ProcessOutput.new('pkg://foo/[email protected],5.11-0.151006:20131230T13000 installed -----', 0)).exactly(2).times | ||
expect(Puppet::Util::Execution).to receive(:execute) | ||
.with(['/bin/pkg', 'update', *hash[:flags], '[email protected]'], {:failonfail => false, :combine => true}) | ||
.and_return(Puppet::Util::Execution::ProcessOutput.new('', 0)) | ||
|
@@ -295,7 +297,9 @@ def self.it_should_respond_to(*actions) | |
|
||
it "should downgrade to specific version" do | ||
resource[:ensure] = '0.0.7' | ||
expect(provider).to receive(:query).with(no_args).and_return({:ensure => '0.0.8,5.11-0.151106:20131230T130000Z'}).exactly(2).times | ||
expect(Puppet::Util::Execution).to receive(:execute) | ||
.with(['/bin/pkg', 'list', '-Hv', 'dummy'], {:failonfail => false, :combine => true}) | ||
.and_return(Puppet::Util::Execution::ProcessOutput.new('pkg://foo/[email protected],5.11-0.151106:20131230T130000Z installed -----', 0)).exactly(2).times | ||
expect(Puppet::Util::Execution).to receive(:execute) | ||
.with(['/bin/pkg', 'update', *hash[:flags], '[email protected]'], {:failonfail => false, :combine => true}) | ||
.and_return(Puppet::Util::Execution::ProcessOutput.new('', 0)) | ||
|