Skip to content

Instantly share code, notes, and snippets.

@spannerinworks
Created May 7, 2015 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spannerinworks/82719e7a0877d9a2444e to your computer and use it in GitHub Desktop.
Save spannerinworks/82719e7a0877d9a2444e to your computer and use it in GitHub Desktop.
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
Copy link
Author

also works with hash_including

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment