1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_{env,hash}.rb: descriptive assertions

* test/ruby/test_{env,hash}.rb: use descriptive assertions than plain
  assert.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-04-09 07:21:50 +00:00
parent f4c52b483c
commit 56486e00ec
2 changed files with 31 additions and 31 deletions

View file

@ -270,15 +270,15 @@ class TestEnv < Test::Unit::TestCase
def test_empty_p
ENV.clear
assert(ENV.empty?)
assert_predicate(ENV, :empty?)
ENV["test"] = "foo"
assert(!ENV.empty?)
assert_not_predicate(ENV, :empty?)
end
def test_has_key
assert(!ENV.has_key?("test"))
assert_not_send([ENV, :has_key?, "test"])
ENV["test"] = "foo"
assert(ENV.has_key?("test"))
assert_send([ENV, :has_key?, "test"])
assert_raise(ArgumentError) { ENV.has_key?("foo\0bar") }
end
@ -298,9 +298,9 @@ class TestEnv < Test::Unit::TestCase
def test_has_value2
ENV.clear
assert(!ENV.has_value?("foo"))
assert_not_send([ENV, :has_value?, "foo"])
ENV["test"] = "foo"
assert(ENV.has_value?("foo"))
assert_send([ENV, :has_value?, "foo"])
end
def test_rassoc