summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-29 05:33:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-29 05:33:43 +0000
commite1cc51407329230aab32088ed67f78b0c5c23e8b (patch)
tree8bafa7bb2284a03c51b61884e930268507ef0e07 /test
parent4c205de3e6fa7da642820fe069734e6321397423 (diff)
* test/ruby: fixed nonsense assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/marshaltestlib.rb2
-rw-r--r--test/ruby/test_array.rb4
-rw-r--r--test/ruby/test_file_exhaustive.rb2
-rw-r--r--test/ruby/test_float.rb4
-rw-r--r--test/ruby/test_iterator.rb2
-rw-r--r--test/ruby/test_module.rb2
-rw-r--r--test/ruby/test_proc.rb2
7 files changed, 9 insertions, 9 deletions
diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb
index 3c8f1228a3..39471aac64 100644
--- a/test/ruby/marshaltestlib.rb
+++ b/test/ruby/marshaltestlib.rb
@@ -287,7 +287,7 @@ module MarshalTestLib
o.extend(Mod1)
str = MyString.new(o, "c")
marshal_equal(str) { |v|
- assert(v.instance_eval { @v }).kind_of?(Mod1)
+ assert(v.instance_eval { @v }.kind_of?(Mod1))
}
end
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index ec1f0fdbb9..fedcec71fc 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1837,8 +1837,8 @@ class TestArray < Test::Unit::TestCase
o = Object.new
def o.to_ary; end
def o.==(x); :foo; end
- assert(:foo, [0, 1, 2] == o)
- assert([0, 1, 2] != [0, 1, 3])
+ assert_equal([0, 1, 2], o)
+ assert_not_equal([0, 1, 2], [0, 1, 3])
end
def test_hash2
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 634197e0a7..7d2f4ca9b9 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -434,7 +434,7 @@ class TestFileExhaustive < Test::Unit::TestCase
end
def test_extname
- assert(".test", File.extname(@file))
+ assert_equal(".test", File.extname(@file))
prefixes = ["", "/", ".", "/.", "bar/.", "/bar/."]
infixes = ["", " ", "."]
infixes2 = infixes + [".ext "]
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 3e5b1177c0..ebb4fb89ae 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -245,8 +245,8 @@ class TestFloat < Test::Unit::TestCase
def test_infinite_p
inf = Float::INFINITY
- assert(1, inf.infinite?)
- assert(1, (-inf).infinite?)
+ assert_equal(1, inf.infinite?)
+ assert_equal(-1, (-inf).infinite?)
assert_nil(1.0.infinite?)
end
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb
index 42e3960e72..362becc0e0 100644
--- a/test/ruby/test_iterator.rb
+++ b/test/ruby/test_iterator.rb
@@ -306,7 +306,7 @@ class TestIterator < Test::Unit::TestCase
rescue LocalJumpError
assert(false, "LocalJumpError occurred from break in lambda")
else
- assert(11, val)
+ assert_equal(11, val)
end
block = get_block{11}
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 453d850bb4..c2084a2e72 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -241,7 +241,7 @@ class TestModule < Test::Unit::TestCase
"foo"
end
end
- assert("foo", Other.class_eval_test)
+ assert_equal("foo", Other.class_eval_test)
assert_equal([Other], Other.class_eval { |*args| args })
end
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 5e04d465ca..dc38f18e81 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -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])
r = proc{|*a| a}.call([1,2,3])
- assert [1,2,3], r
+ assert_equal [[1,2,3]], r
end
def test_proc_args_rest_and_post