diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_lambda.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_object.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_optimization.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_parse.rb | 1 | ||||
-rw-r--r-- | test/ruby/test_rand.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_refinement.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_super.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_system.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_time.rb | 1 | ||||
-rw-r--r-- | test/ruby/test_time_tz.rb | 4 |
13 files changed, 20 insertions, 23 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index 24efa71bc1..f45ca6af71 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -91,7 +91,7 @@ class TestLambdaParameters < Test::Unit::TestCase end def return_in_current(val) - 1.tap &->(*) {return 0} + 1.tap(&->(*) {return 0}) val end @@ -100,7 +100,7 @@ class TestLambdaParameters < Test::Unit::TestCase end def return_in_callee(val) - yield_block &->(*) {return 0} + yield_block(&->(*) {return 0}) val end diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 760db95f7b..8ac3340173 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -313,11 +313,11 @@ class TestLazyEnumerator < Test::Unit::TestCase def test_take_rewound bug7696 = '[ruby-core:51470]' e=(1..42).lazy.take(2) - assert_equal 1, e.next - assert_equal 2, e.next + assert_equal 1, e.next, bug7696 + assert_equal 2, e.next, bug7696 e.rewind - assert_equal 1, e.next - assert_equal 2, e.next + assert_equal 1, e.next, bug7696 + assert_equal 2, e.next, bug7696 end def test_take_while diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 02739dd520..b5e128ba3c 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1258,7 +1258,7 @@ class TestModule < Test::Unit::TestCase c = Class.new do attr_writer :foo end - assert_raise(ArgumentError) { c.new.send :foo= } + assert_raise(ArgumentError, bug8540) { c.new.send :foo= } end def test_private_constant diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 7db41a6530..f305cc7228 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -801,7 +801,7 @@ class TestObject < Test::Unit::TestCase end def test_type_error_message - issue = "Bug #7539" + _issue = "Bug #7539" assert_raise_with_message(TypeError, "can't convert Array into Integer") {Integer([42])} assert_raise_with_message(TypeError, 'no implicit conversion of Array into Integer') {[].first([42])} end diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index fe25cdf1c9..91356e8ed4 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -163,7 +163,7 @@ class TestRubyOptimization < Test::Unit::TestCase tailcall_optimization: true, trace_instruction: false, } - iseq = RubyVM::InstructionSequence.new(<<-EOF, "Bug#4082", bug4082, nil, option).eval + RubyVM::InstructionSequence.new(<<-EOF, "Bug#4082", bug4082, nil, option).eval class #{self.class}::Tailcall def fact_helper(n, res) if n == 1 @@ -187,7 +187,7 @@ class TestRubyOptimization < Test::Unit::TestCase tailcall_optimization: true, trace_instruction: false, } - iseq = RubyVM::InstructionSequence.new(<<-EOF, "Bug#6901", bug6901, nil, option).eval + RubyVM::InstructionSequence.new(<<-EOF, "Bug#6901", bug6901, nil, option).eval def identity(val) val end diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 863d379096..8f957bbc58 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -218,7 +218,6 @@ class TestParse < Test::Unit::TestCase def o.>(x); x; end def o./(x); x; end - a = nil assert_nothing_raised do o.instance_eval <<-END, __FILE__, __LINE__+1 undef >, / diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 7b68bc38d0..62efecb833 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -210,7 +210,8 @@ class TestRand < Test::Unit::TestCase assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0..-1) } assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0.0...0.0) } assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0.0...-0.1) } - assert_raise(ArgumentError, bug3027 = '[ruby-core:29075]') { r.rand(nil) } + bug3027 = '[ruby-core:29075]' + assert_raise(ArgumentError, bug3027) { r.rand(nil) } end def test_random_seed @@ -420,7 +421,7 @@ END (1..10).to_a.shuffle raise 'default seed is not set' if srand == 0 end - p2, st = Process.waitpid2(pid) + _, st = Process.waitpid2(pid) assert_predicate(st, :success?, "#{st.inspect}") rescue NotImplementedError, ArgumentError end diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index d535c47424..88754df75b 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -259,7 +259,7 @@ class TestRefinement < Test::Unit::TestCase def test_return_value_of_refine mod = nil result = nil - m = Module.new { + Module.new { result = refine(Object) { mod = self } @@ -433,7 +433,6 @@ class TestRefinement < Test::Unit::TestCase end def test_module_using_class - c = Class.new assert_raise(TypeError) do eval("using TestRefinement::UsingClass", TOPLEVEL_BINDING) end diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 82d6e19ec4..9425cc83eb 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -194,7 +194,7 @@ class TestSuper < Test::Unit::TestCase end end overlaid.call(str = "123") - overlaid.call(ary = [1,2,3]) + overlaid.call([1,2,3]) str.reverse end @@ -318,7 +318,6 @@ class TestSuper < Test::Unit::TestCase } sub_class = Class.new(super_class) { def foo - x = Object.new lambda { super() } end } diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index db19a3c2cd..9e4369540a 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -86,7 +86,7 @@ class TestSystem < Test::Unit::TestCase File.unlink tmpfilename testname = '[ruby-core:44505]' - assert_match /Windows/, `ver`, testname + assert_match(/Windows/, `ver`, testname) assert_equal 0, $?.to_i, testname end } diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 6622d48654..62e0a2ee4b 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -511,8 +511,8 @@ class TestThread < Test::Unit::TestCase def test_no_valid_cfp skip 'with win32ole, cannot run this testcase because win32ole redefines Thread#intialize' if defined?(WIN32OLE) bug5083 = '[ruby-dev:44208]' - assert_equal([], Thread.new(&Module.method(:nesting)).value) - assert_instance_of(Thread, Thread.new(:to_s, &Class.new.method(:undef_method)).join) + assert_equal([], Thread.new(&Module.method(:nesting)).value, bug5083) + assert_instance_of(Thread, Thread.new(:to_s, &Class.new.method(:undef_method)).join, bug5083) end def make_handle_interrupt_test_thread1 flag diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 744ac4c39f..c8b9e8f175 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -1,5 +1,4 @@ require 'test/unit' -require 'rational' require 'delegate' require 'timeout' require 'delegate' diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb index bb69af87b4..1e8f303274 100644 --- a/test/ruby/test_time_tz.rb +++ b/test/ruby/test_time_tz.rb @@ -150,7 +150,7 @@ class TestTimeTZ < Test::Unit::TestCase end def test_europe_lisbon - with_tz(tz="Europe/Lisbon") { + with_tz("Europe/Lisbon") { assert_equal("LMT", Time.new(-0x1_0000_0000_0000_0000).zone) } end if has_right_tz @@ -250,7 +250,7 @@ class TestTimeTZ < Test::Unit::TestCase } } group_by(sample) {|tz, _, _, _| tz }.each {|tz, a| - a.each_with_index {|(_, u, l, gmtoff), i| + a.each_with_index {|(_, _, l, gmtoff), i| expected = "%04d-%02d-%02d %02d:%02d:%02d %s" % (l+[format_gmtoff(gmtoff)]) monotonic_to_past = i == 0 || (a[i-1][2] <=> l) < 0 monotonic_to_future = i == a.length-1 || (l <=> a[i+1][2]) < 0 |