Skip to content

Commit 8c149e9

Browse files
committed
Add the ability to use kind_of matchers
This allows you to check the return type of functions, like this example: ``` is_expected.to run.with_params('mymod/template.epp', { 'foo' => 'bar' }).and_return(kind_of String) ```
1 parent e54b31e commit 8c149e9

File tree

1 file changed

+2
-0
lines changed
  • lib/rspec-puppet/matchers

1 file changed

+2
-0
lines changed

lib/rspec-puppet/matchers/run.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def matches?(func_obj)
3535
case @expected_return
3636
when Regexp
3737
return !!(@actual_return =~ @expected_return)
38+
when RSpec::Mocks::ArgumentMatchers::KindOf, RSpec::Matchers::AliasedMatcher
39+
return @expected_return === @actual_return
3840
else
3941
return @actual_return == @expected_return
4042
end

0 commit comments

Comments
 (0)