mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-21 01:03:20 -04:00
Updated koans from source directory.
This commit is contained in:
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
||||
def my_global_method(a,b)
|
||||
a + b
|
||||
end
|
||||
|
||||
|
||||
class AboutMethods < EdgeCase::Koan
|
||||
|
||||
def test_calling_global_methods
|
||||
@@ -29,19 +29,19 @@ class AboutMethods < EdgeCase::Koan
|
||||
# Rewrite the eval string to continue.
|
||||
#
|
||||
end
|
||||
|
||||
|
||||
# NOTE: wrong number of argument is not a SYNTAX error, but a
|
||||
# runtime error.
|
||||
def test_calling_global_methods_with_wrong_number_of_arguments
|
||||
exception = assert_raise(___) do
|
||||
my_global_method
|
||||
end
|
||||
assert_match(/__/, exception.message)
|
||||
assert_match(/#{__ of arguments")}/, exception.message)
|
||||
|
||||
exception = assert_raise(___) do
|
||||
my_global_method(1,2,3)
|
||||
end
|
||||
assert_match(/__/, exception.message)
|
||||
assert_match(/#{__ of arguments")}/, exception.message)
|
||||
end
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
@@ -135,7 +135,7 @@ class AboutMethods < EdgeCase::Koan
|
||||
"tail"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def test_calling_methods_in_other_objects_require_explicit_receiver
|
||||
rover = Dog.new
|
||||
assert_equal __, rover.name
|
||||
|
||||
Reference in New Issue
Block a user