mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove _spectator_calls method with filter
This commit is contained in:
parent
3589f23475
commit
8aed5027aa
6 changed files with 5 additions and 12 deletions
|
@ -355,7 +355,7 @@ Spectator.describe Spectator::Double do
|
|||
it "stores arguments for a call" do
|
||||
dbl.foo(42)
|
||||
args = Spectator::Arguments.capture(42)
|
||||
call = dbl._spectator_calls(:foo).first
|
||||
call = dbl._spectator_calls.first
|
||||
expect(call.arguments).to eq(args)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -297,7 +297,7 @@ Spectator.describe Spectator::LazyDouble do
|
|||
it "stores arguments for a call" do
|
||||
dbl.foo(42)
|
||||
args = Spectator::Arguments.capture(42)
|
||||
call = dbl._spectator_calls(:foo).first
|
||||
call = dbl._spectator_calls.first
|
||||
expect(call.arguments).to eq(args)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -324,7 +324,7 @@ Spectator.describe Spectator::NullDouble do
|
|||
it "stores arguments for a call" do
|
||||
dbl.foo(42)
|
||||
args = Spectator::Arguments.capture(42)
|
||||
call = dbl._spectator_calls(:foo).first
|
||||
call = dbl._spectator_calls.first
|
||||
expect(call.arguments).to eq(args)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -121,10 +121,6 @@ module Spectator
|
|||
@calls
|
||||
end
|
||||
|
||||
def _spectator_calls(method : Symbol) : Enumerable(MethodCall)
|
||||
@calls.select { |call| call.method == method }
|
||||
end
|
||||
|
||||
# Returns the double's name formatted for user output.
|
||||
private def _spectator_stubbed_name : String
|
||||
{% if anno = @type.annotation(StubbedName) %}
|
||||
|
|
|
@ -22,9 +22,6 @@ module Spectator
|
|||
# Retrieves an mutable collection of stubs.
|
||||
abstract def _spectator_stubs
|
||||
|
||||
# Retrieves an mutable collection of calls to stubs.
|
||||
abstract def _spectator_calls
|
||||
|
||||
def _spectator_define_stub(stub : ::Spectator::Stub) : Nil
|
||||
_spectator_stubs.unshift(stub)
|
||||
end
|
||||
|
|
|
@ -34,8 +34,8 @@ module Spectator
|
|||
# Saves a call that was made to a stubbed method.
|
||||
abstract def _spectator_record_call(call : MethodCall) : Nil
|
||||
|
||||
# Retrieves all previously saved calls for the specified method.
|
||||
abstract def _spectator_calls(method : Symbol) : Enumerable(MethodCall)
|
||||
# Retrieves all previously saved calls.
|
||||
abstract def _spectator_calls
|
||||
|
||||
# Method called when a stub isn't found.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue