summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_case.rb4
-rw-r--r--test/ruby/test_rubyoptions.rb6
-rw-r--r--test/ruby/test_transcode.rb2
3 files changed, 8 insertions, 4 deletions
diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb
index f9f16d55a2..c4938ee55a 100644
--- a/test/ruby/test_case.rb
+++ b/test/ruby/test_case.rb
@@ -57,11 +57,11 @@ class TestCase < Test::Unit::TestCase
def test_deoptimization
assert_in_out_err(['-e', <<-EOS], '', %w[42], [])
- class Symbol; def ===(o); p 42; true; end; end; case :foo; when :foo; end
+ class Symbol; undef ===; def ===(o); p 42; true; end; end; case :foo; when :foo; end
EOS
assert_in_out_err(['-e', <<-EOS], '', %w[42], [])
- class Fixnum; def ===(o); p 42; true; end; end; case 1; when 1; end
+ class Fixnum; undef ===; def ===(o); p 42; true; end; end; case 1; when 1; end
EOS
end
end
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index f1897c5d0b..771d7cdfff 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -38,10 +38,14 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_warning
+ save_rubyopt = ENV['RUBYOPT']
+ ENV['RUBYOPT'] = nil
assert_in_out_err(%w(-W0 -e) + ['p $-W'], "", %w(0), [])
assert_in_out_err(%w(-W1 -e) + ['p $-W'], "", %w(1), [])
assert_in_out_err(%w(-Wx -e) + ['p $-W'], "", %w(1), [])
assert_in_out_err(%w(-W -e) + ['p $-W'], "", %w(2), [])
+ ensure
+ ENV['RUBYOPT'] = save_rubyopt
end
def test_safe_level
@@ -271,7 +275,7 @@ class TestRubyOptions < Test::Unit::TestCase
def test_sflag
assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz),
- "#!ruby -s\np [$abc, $def, $ghi_jkl, $xyz]\n",
+ "#!ruby -s\np [$abc, $def, $ghi_jkl, defined?($xyz)]\n",
['[true, "foo", true, nil]'], [])
assert_in_out_err(%w(- -#), "#!ruby -s\n", [],
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
index 9d4305876f..bca51ba251 100644
--- a/test/ruby/test_transcode.rb
+++ b/test/ruby/test_transcode.rb
@@ -909,7 +909,7 @@ class TestTranscode < Test::Unit::TestCase
assert_raise(Encoding::UndefinedConversionError) { "\xFF".encode("utf-8", 'TIS-620') }
end
- def test_CP850
+ def test_CP850
check_both_ways("\u00C7", "\x80", 'CP850') # Ç
check_both_ways("\u00C5", "\x8F", 'CP850') # Å
check_both_ways("\u00C9", "\x90", 'CP850') # É