moar progress
This commit is contained in:
@@ -7,10 +7,10 @@ class AboutKeywordArguments < Neo::Koan
|
||||
end
|
||||
|
||||
def test_keyword_arguments
|
||||
assert_equal __, method_with_keyword_arguments.class
|
||||
assert_equal __, method_with_keyword_arguments
|
||||
assert_equal __, method_with_keyword_arguments(one: 'one')
|
||||
assert_equal __, method_with_keyword_arguments(two: 2)
|
||||
assert_equal Array, method_with_keyword_arguments.class
|
||||
assert_equal [1, "two"], method_with_keyword_arguments
|
||||
assert_equal ['one', 'two'], method_with_keyword_arguments(one: 'one')
|
||||
assert_equal [1, 2], method_with_keyword_arguments(two: 2)
|
||||
end
|
||||
|
||||
def method_with_keyword_arguments_with_mandatory_argument(one, two: 2, three: 3)
|
||||
@@ -18,10 +18,10 @@ class AboutKeywordArguments < Neo::Koan
|
||||
end
|
||||
|
||||
def test_keyword_arguments_with_wrong_number_of_arguments
|
||||
exception = assert_raise (___) do
|
||||
exception = assert_raise (ArgumentError) do
|
||||
method_with_keyword_arguments_with_mandatory_argument
|
||||
end
|
||||
assert_match(/__/, exception.message)
|
||||
assert_match(/wrong number of arguments/, exception.message)
|
||||
end
|
||||
|
||||
# THINK ABOUT IT:
|
||||
|
||||
Reference in New Issue
Block a user