Output Tuple info

This commit is contained in:
Michael Miller 2019-03-22 00:24:04 -06:00
parent dba047e1ec
commit acfed24e6c

View file

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