Skip to content

Instantly share code, notes, and snippets.

@mckomo
Last active June 5, 2018 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mckomo/c34e59f87a98c71654e43e74daebc0d1 to your computer and use it in GitHub Desktop.
Save mckomo/c34e59f87a98c71654e43e74daebc0d1 to your computer and use it in GitHub Desktop.
Kata extract_strings.rb
def extract_strings(object)
# TODO
end
errors = {
options: {
frequency_limits: [
{
time_unit: [
'must be one of: day, week, month'
]
},
{
ads_quantity: [
'must be greater than 10'
]
}
]
}
}
expected = ['must be one of: day, week, month', 'must be greater than 10']
actual = extract_strings(errors)
unless actual == expected
raise "Invalid result: #{actual}. Expected: #{expected}"
end
puts 'SUCCESS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment