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

* test/ruby: fixed nonsense assertions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-29 05:33:43 +00:00
parent 4c205de3e6
commit e1cc514073
8 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,6 @@
Thu Apr 29 14:24:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Apr 29 14:33:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby: fixed nonsense assertions.
* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):
reverted. [ruby-core:29872] reverted. [ruby-core:29872]

View file

@ -287,7 +287,7 @@ module MarshalTestLib
o.extend(Mod1) o.extend(Mod1)
str = MyString.new(o, "c") str = MyString.new(o, "c")
marshal_equal(str) { |v| marshal_equal(str) { |v|
assert(v.instance_eval { @v }).kind_of?(Mod1) assert(v.instance_eval { @v }.kind_of?(Mod1))
} }
end end

View file

@ -1837,8 +1837,8 @@ class TestArray < Test::Unit::TestCase
o = Object.new o = Object.new
def o.to_ary; end def o.to_ary; end
def o.==(x); :foo; end def o.==(x); :foo; end
assert(:foo, [0, 1, 2] == o) assert_equal([0, 1, 2], o)
assert([0, 1, 2] != [0, 1, 3]) assert_not_equal([0, 1, 2], [0, 1, 3])
end end
def test_hash2 def test_hash2

View file

@ -434,7 +434,7 @@ class TestFileExhaustive < Test::Unit::TestCase
end end
def test_extname def test_extname
assert(".test", File.extname(@file)) assert_equal(".test", File.extname(@file))
prefixes = ["", "/", ".", "/.", "bar/.", "/bar/."] prefixes = ["", "/", ".", "/.", "bar/.", "/bar/."]
infixes = ["", " ", "."] infixes = ["", " ", "."]
infixes2 = infixes + [".ext "] infixes2 = infixes + [".ext "]

View file

@ -245,8 +245,8 @@ class TestFloat < Test::Unit::TestCase
def test_infinite_p def test_infinite_p
inf = Float::INFINITY inf = Float::INFINITY
assert(1, inf.infinite?) assert_equal(1, inf.infinite?)
assert(1, (-inf).infinite?) assert_equal(-1, (-inf).infinite?)
assert_nil(1.0.infinite?) assert_nil(1.0.infinite?)
end end

View file

@ -306,7 +306,7 @@ class TestIterator < Test::Unit::TestCase
rescue LocalJumpError rescue LocalJumpError
assert(false, "LocalJumpError occurred from break in lambda") assert(false, "LocalJumpError occurred from break in lambda")
else else
assert(11, val) assert_equal(11, val)
end end
block = get_block{11} block = get_block{11}

View file

@ -241,7 +241,7 @@ class TestModule < Test::Unit::TestCase
"foo" "foo"
end end
end end
assert("foo", Other.class_eval_test) assert_equal("foo", Other.class_eval_test)
assert_equal([Other], Other.class_eval { |*args| args }) assert_equal([Other], Other.class_eval { |*args| args })
end end

View file

@ -379,7 +379,7 @@ class TestProc < Test::Unit::TestCase
assert_equal [1,2,3,[4,5,6]], pr.call([1,2,3,4,5,6]) assert_equal [1,2,3,[4,5,6]], pr.call([1,2,3,4,5,6])
r = proc{|*a| a}.call([1,2,3]) r = proc{|*a| a}.call([1,2,3])
assert [1,2,3], r assert_equal [[1,2,3]], r
end end
def test_proc_args_rest_and_post def test_proc_args_rest_and_post