Open rayward opened 6 years ago
It'd be great if the built-in rspec matchers (or anything that conforms to the protocol - https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/matcher_protocol.rb) could be used when testing a class parameter.
I have class that takes a complex hash as one of its parameters, I'd like to test that this hash includes a particular key/value under a certain context.
Right now I have to convert the include matcher to a proc to make this work:
include
is_expected.to contain_class('foo').with_settings(include('hello' => 'world').method(:matches?).to_proc)
I'd be nice if this matcher could be composed in a more fluid manner.
@rayward I'm not planning on changing the matcher API significantly in 2.x, but using the built in matchers is planned for 3.x
Awesome, great to hear its already coming!
It'd be great if the built-in rspec matchers (or anything that conforms to the protocol - https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/matcher_protocol.rb) could be used when testing a class parameter.
I have class that takes a complex hash as one of its parameters, I'd like to test that this hash includes a particular key/value under a certain context.
Right now I have to convert the
include
matcher to a proc to make this work:I'd be nice if this matcher could be composed in a more fluid manner.