mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Handle union case for expected value
When using both forms of the HaveMatcher - expected can be a Char, String, or Regex. Regex is invalid for String#includes?. I believe this might be a generics issue that was fixed recently in Crystal.
This commit is contained in:
parent
353e5f6886
commit
8b718f0bd0
1 changed files with 1 additions and 0 deletions
|
@ -19,6 +19,7 @@ module Spectator::Matchers
|
||||||
private def match_string?(actual_value)
|
private def match_string?(actual_value)
|
||||||
expected.value.all? do |item|
|
expected.value.all? do |item|
|
||||||
actual_value.includes?(item)
|
actual_value.includes?(item)
|
||||||
|
actual_value.includes?(item) if item.is_a?(Char | String)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue