mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add spec for match
(regex) matcher
This commit is contained in:
parent
260e1884ab
commit
a32b511e0b
3 changed files with 119 additions and 1 deletions
|
@ -7,6 +7,9 @@ class SpySUT
|
|||
# Number of times the `#===` method was called.
|
||||
getter case_eq_call_count = 0
|
||||
|
||||
# Number of times the `#=~` method was called.
|
||||
getter match_call_count = 0
|
||||
|
||||
# Returns true and increments `#eq_call_count`.
|
||||
def ==(other : T) forall T
|
||||
@eq_call_count += 1
|
||||
|
@ -18,4 +21,10 @@ class SpySUT
|
|||
@case_eq_call_count += 1
|
||||
true
|
||||
end
|
||||
|
||||
# Returns true and increments `#match_eq_call_count`.
|
||||
def =~(other : T) forall T
|
||||
@match_call_count += 1
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue