diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-13 09:18:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-13 09:18:05 +0000 |
commit | 3ac0ec4ecdea849143ed64e8935e6675b341e44b (patch) | |
tree | fe18c8213610bfdbca51b687133caf5ab297b882 /test/ruby/test_struct.rb | |
parent | 287d2adab0ce45018ada9941ce4eaf67ba6a4d3a (diff) |
test/ruby: better assertions
* test/ruby: use better assertions instead of mere assert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r-- | test/ruby/test_struct.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index 6589f0a24b..8aa99c52fb 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -189,14 +189,14 @@ module TestStruct o1 = klass1.new(1) o2 = klass1.new(1) o3 = klass2.new(1) - assert(o1.==(o2)) - assert(o1 != o3) + assert_equal(o1, o2) + assert_not_equal(o1, o3) end def test_hash klass = @Struct.new(:a) o = klass.new(1) - assert(o.hash.is_a?(Fixnum)) + assert_kind_of(Fixnum, o.hash) end def test_eql @@ -205,8 +205,8 @@ module TestStruct o1 = klass1.new(1) o2 = klass1.new(1) o3 = klass2.new(1) - assert(o1.eql?(o2)) - assert(!(o1.eql?(o3))) + assert_operator(o1, :eql?, o2) + assert_not_operator(o1, :eql?, o3) end def test_size @@ -255,26 +255,26 @@ module TestStruct x = klass1.new(1, 2, nil); x.c = x y = klass1.new(1, 2, nil); y.c = y Timeout.timeout(1) { - assert x == y - assert x.eql? y + assert_equal x, y + assert_operator x, :eql?, y } z = klass1.new(:something, :other, nil); z.c = z Timeout.timeout(1) { - assert x != z - assert !x.eql?(z) + assert_not_equal x, z + assert_not_operator x, :eql?, z } x.c = y; y.c = x Timeout.timeout(1) { - assert x == y - assert x.eql?(y) + assert_equal x, y + assert_operator x, :eql?, y } x.c = z; z.c = x Timeout.timeout(1) { - assert x != z - assert !x.eql?(z) + assert_not_equal x, z + assert_not_operator x, :eql?, z } end |