Skip to content

Commit

Permalink
Merge pull request rodjek#274 from DavidS/include-pops-from-puppet4
Browse files Browse the repository at this point in the history
Include pops from puppet4
  • Loading branch information
hunner committed Apr 22, 2015
2 parents 74bad8a + 7b18760 commit 4ff4fd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec-puppet/matchers/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def matches?(func_obj)

def with_params(*params)
@params = params
# stringify immediatly to protect us from the params being changed by
# stringify immediately to protect us from the params being changed by
# the subject, e.g. with params.shift
@func_args = @params.inspect[1..-2]
self
Expand Down
3 changes: 3 additions & 0 deletions lib/rspec-puppet/setup.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require 'puppet'
if Puppet.version.to_f >= 4.0
require 'puppet/pops'
end
require 'fileutils'

module RSpec::Puppet
Expand Down
4 changes: 4 additions & 0 deletions spec/functions/nasty_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require 'spec_helper'

describe 'nasty' do

it { expect(subject).not_to eq(nil) }
it { expect(subject).to run.with_params('foo', 'bar').and_return('foo') }

describe 'the underlying Run matcher' do
it 'should not have its description manipulated by running the function' do
run_matcher = run.with_params('foo', 'bar').and_return('foo')
Expand Down

0 comments on commit 4ff4fd2

Please sign in to comment.