Actually show type of values

This commit is contained in:
Michael Miller 2019-03-22 00:26:27 -06:00
parent acfed24e6c
commit 7b10330904

View file

@ -1,6 +1,6 @@
# Retrieves a value from the `NamedTuple` returned by `Spectator::Matchers::MatchData#values`.
def match_data_value(match_data, key)
puts typeof(match_data)
puts typeof(match_data.values)
match_data.values.fetch(key) { raise "#{key} is missing" }
end
@ -8,7 +8,7 @@ end
# from a `Spectator::Matchers::PrefixedValue`
# in a `NamedTuple` returned by `Spectator::Matchers::MatchData#values`.
def match_data_prefix(match_data, key)
puts typeof(match_data)
puts typeof(match_data.values)
prefix = match_data.values.fetch(key) { raise "#{key} is missing" }
if prefix.responds_to?(:value)
{to_s: prefix.to_s, value: prefix.value}