mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_struct.rb: use assert_same
* test/ruby/test_struct.rb (test_question_mark_in_member): true value has no meanings itself. use assert_same instead. * test/ruby/test_struct.rb (test_bang_mark_in_member): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bc7abeb37b
commit
77280b6cd6
1 changed files with 6 additions and 4 deletions
|
@ -286,14 +286,16 @@ module TestStruct
|
|||
|
||||
def test_question_mark_in_member
|
||||
klass = @Struct.new(:a, :b?)
|
||||
o = klass.new("test", true)
|
||||
assert_predicate(o, :b?)
|
||||
x = Object.new
|
||||
o = klass.new("test", x)
|
||||
assert_same(x, o.b?)
|
||||
end
|
||||
|
||||
def test_bang_mark_in_member
|
||||
klass = @Struct.new(:a, :b!)
|
||||
o = klass.new("test", true)
|
||||
assert_predicate(o, :b!)
|
||||
x = Object.new
|
||||
o = klass.new("test", x)
|
||||
assert_same(x, o.b!)
|
||||
end
|
||||
|
||||
class TopStruct < Test::Unit::TestCase
|
||||
|
|
Loading…
Add table
Reference in a new issue