rodjek / rspec-puppet

RSpec tests for your Puppet manifests
http://rspec-puppet.com
MIT License
364 stars 203 forks source link

Dynamic matchers can't be composed #365

Open jerith opened 8 years ago

jerith commented 8 years ago

The various dynamic matchers (contain_class, etc.) can't be composed or easily used in custom matchers. The problem is that rspec's values_match? method uses expected === actual to test for a match and the dynamic matchers don't implement #===.

A possible solution is to add a #=== method (or alias) to each of the CreateGeneric classes that delegates to #matches? so that values_match? checks for a match instead of object equality.

rodjek commented 7 years ago

@jerith you might be interested in #611