summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb7
-rw-r--r--test/ruby/test_rubyoptions.rb4
2 files changed, 5 insertions, 6 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 4bc44eff04..a1726bf63b 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -230,8 +230,11 @@ class TestRequire < Test::Unit::TestCase
abs_dir = "#{ abs_dir }"
$: << abs_dir.taint
$SAFE = 1
- require "#{ t.path }"
- p :ok
+ begin
+ require "#{ file }"
+ rescue SecurityError
+ p :ok
+ end
INPUT
assert_in_out_err([], <<-INPUT, %w(:ok), [])
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 909c8f469e..59be99164a 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -199,16 +199,12 @@ class TestRubyOptions < Test::Unit::TestCase
ENV['RUBYOPT'] = ' - -'
assert_in_out_err([], "", [], [])
- assert_in_out_err(['-e', 'p $:.include?(".")'], "", ["false"], [])
-
ENV['RUBYOPT'] = '-e "p 1"'
assert_in_out_err([], "", [], /invalid switch in RUBYOPT: -e \(RuntimeError\)/)
ENV['RUBYOPT'] = '-T1'
assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/)
- assert_in_out_err(['-e', 'p $:.include?(".")'], "", ["false"], [])
-
ENV['RUBYOPT'] = '-T4'
assert_in_out_err([], "", [], /no program input from stdin allowed in tainted mode \(SecurityError\)/)