[前][次][番号順一覧][スレッド一覧]

ruby-changes:31967

From: nobu <ko1@a...>
Date: Sat, 7 Dec 2013 10:47:26 +0900 (JST)
Subject: [ruby-changes:31967] nobu:r44046 (trunk): test_struct.rb: use assert_same

nobu	2013-12-07 10:47:22 +0900 (Sat, 07 Dec 2013)

  New Revision: 44046

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44046

  Log:
    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.

  Modified files:
    trunk/test/ruby/test_struct.rb
Index: test/ruby/test_struct.rb
===================================================================
--- test/ruby/test_struct.rb	(revision 44045)
+++ test/ruby/test_struct.rb	(revision 44046)
@@ -286,14 +286,16 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L286
 
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]