Last active
June 5, 2018 10:34
-
-
Save mckomo/c34e59f87a98c71654e43e74daebc0d1 to your computer and use it in GitHub Desktop.
Kata extract_strings.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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