Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rspec hash with regex values
RSpec.describe 'test' do
it 'works' do
a = {a: 1, b: 'foobar'}
d = double
expect(d).to receive(:meh).with(a: 1, b: match(/ob/))
d.meh(a)
end
end
@spannerinworks

This comment has been minimized.

Copy link
Owner Author

spannerinworks commented May 7, 2015

also works with hash_including

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.