Copy-paste and tweak to implement argument expectations

This commit is contained in:
Michael Miller 2019-11-03 14:48:08 -07:00
parent 4acf6aaa58
commit 82e01e44de
2 changed files with 7 additions and 2 deletions

View File

@ -314,8 +314,8 @@ Items not marked as completed may have partial implementations.
- [X] Doubles (Stand-ins for real types) - `double NAME { }`
- [X] Method stubs - `allow().to receive()`, `allow().to receive().and_return()`
- [ ] Spies - `expect().to receive()`
- [ ] Message expectations - `expect().to receive().at_least()`
- [ ] Argument expectations - `expect().to receive().with()`
- [X] Message expectations - `expect().to receive().at_least()`
- [X] Argument expectations - `expect().to receive().with()`
- [ ] Message ordering - `expect().to receive().ordered`
- [ ] Null doubles
- [ ] Runner

View File

@ -38,6 +38,11 @@ module Spectator::Matchers
}
end
def with(*args, **opts)
args = Mocks::GenericArguments.new(args, opts)
ReceiveArgumentsMatcher.new(@expected, args, @range)
end
def once
ReceiveMatcher.new(@expected, (1..1))
end