diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index 67e76ece2..a047f019c 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -69,7 +69,7 @@ class Integer # Calls the given block +self+ times. # # ISO 15.2.8.3.22 - def times &block + def times(&block) return to_enum :times unless block i = 0 diff --git a/test/t/bs_block.rb b/test/t/bs_block.rb index c37d1b538..08580d58a 100644 --- a/test/t/bs_block.rb +++ b/test/t/bs_block.rb @@ -313,7 +313,7 @@ assert('BS Block 25') do end assert('BS Block 26') do - def m a + def m(a) yield a end assert_equal(2) do diff --git a/test/t/class.rb b/test/t/class.rb index 1b4b84890..f4d99318a 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -40,7 +40,7 @@ assert('Class#new', '15.2.3.3.3') do end class TestClass - def initialize args, &block + def initialize(args, &block) @result = if not args.nil? and block.nil? # only arguments :only_args diff --git a/test/t/float.rb b/test/t/float.rb index e4c25b34e..1a7f6c99a 100644 --- a/test/t/float.rb +++ b/test/t/float.rb @@ -216,7 +216,7 @@ assert('Float#truncate', '15.2.9.3.15') do end assert('Float#divmod') do - def check_floats exp, act + def check_floats(exp, act) assert_float exp[0], act[0] assert_float exp[1], act[1] end