Add spec for match (regex) matcher

This commit is contained in:
Michael Miller 2019-01-19 14:49:13 -07:00
parent 260e1884ab
commit a32b511e0b
3 changed files with 119 additions and 1 deletions

View file

@ -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