summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r--test/ruby/test_object.rb38
1 files changed, 21 insertions, 17 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 7b660ce87c7..b46403ad6f0 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -652,29 +652,33 @@ class TestObject < Test::Unit::TestCase
end
def test_untrusted
- obj = Object.new
- assert_equal(false, obj.untrusted?)
- assert_equal(false, obj.tainted?)
- obj.untrust
- assert_equal(true, obj.untrusted?)
- assert_equal(true, obj.tainted?)
- obj.trust
- assert_equal(false, obj.untrusted?)
- assert_equal(false, obj.tainted?)
- obj.taint
- assert_equal(true, obj.untrusted?)
- assert_equal(true, obj.tainted?)
- obj.untaint
- assert_equal(false, obj.untrusted?)
- assert_equal(false, obj.tainted?)
+ verbose = $VERBOSE
+ $VERBOSE = false
+ begin
+ obj = Object.new
+ assert_equal(false, obj.untrusted?)
+ assert_equal(false, obj.tainted?)
+ obj.untrust
+ assert_equal(true, obj.untrusted?)
+ assert_equal(true, obj.tainted?)
+ obj.trust
+ assert_equal(false, obj.untrusted?)
+ assert_equal(false, obj.tainted?)
+ obj.taint
+ assert_equal(true, obj.untrusted?)
+ assert_equal(true, obj.tainted?)
+ obj.untaint
+ assert_equal(false, obj.untrusted?)
+ assert_equal(false, obj.tainted?)
+ ensure
+ $VERBOSE = verbose
+ end
end
def test_to_s
x = Object.new
x.taint
- x.untrust
s = x.to_s
- assert_equal(true, s.untrusted?)
assert_equal(true, s.tainted?)
x = eval(<<-EOS)