Last active
July 14, 2016 01:23
-
-
Save ramfjord/1f7a9f3809d644563994b811fb375487 to your computer and use it in GitHub Desktop.
Rspec varargs argument matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Actual test | |
it "prefixes each of it's locks with :prefix:" do | |
expect(ZookeeperLocker).to receive(:lock_no_retry) | |
.with(start_with("hello")) | |
lock_for_time_range "hello", @window do | |
# nothing | |
end | |
end | |
# Failure message | |
Failure/Error: lock_for_time_range "hello", @window do | |
<ZookeeperLocker (class)> received :lock_no_retry with unexpected arguments | |
expected: (start with "hello") | |
got: ("hello_20160711182245", "hello_20160712182245", "hello_20160713182245") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment