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

ruby-changes:31794

From: tmm1 <ko1@a...>
Date: Wed, 27 Nov 2013 15:03:44 +0900 (JST)
Subject: [ruby-changes:31794] tmm1:r43873 (trunk): * test/ruby/test_eval.rb (class TestEval): Use assert_same instead of

tmm1	2013-11-27 15:03:37 +0900 (Wed, 27 Nov 2013)

  New Revision: 43873

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

  Log:
    * test/ruby/test_eval.rb (class TestEval): Use assert_same instead of
      assert_equal.
    * test/ruby/test_hash.rb (class TestHash): ditto.
    * test/ruby/test_iseq.rb (class TestISeq): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_eval.rb
    trunk/test/ruby/test_hash.rb
    trunk/test/ruby/test_iseq.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43872)
+++ ChangeLog	(revision 43873)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Nov 27 15:02:53 2013  Aman Gupta <ruby@t...>
+
+	* test/ruby/test_eval.rb (class TestEval): Use assert_same instead of
+	  assert_equal.
+	* test/ruby/test_hash.rb (class TestHash): ditto.
+	* test/ruby/test_iseq.rb (class TestISeq): ditto.
+
 Wed Nov 27 14:50:02 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rinda/ring.rb:  Announce RingServer for the same process.
Index: test/ruby/test_eval.rb
===================================================================
--- test/ruby/test_eval.rb	(revision 43872)
+++ test/ruby/test_eval.rb	(revision 43873)
@@ -482,7 +482,6 @@ class TestEval < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_eval.rb#L482
     a, b = o.method(:foo).source_location[0],
            o.method(:bar).source_location[0]
 
-    assert_equal a.object_id, b.object_id,
-      "#{a.inspect}.object_id != #{b.inspect}.object_id"
+    assert_same a, b
   end
 end
Index: test/ruby/test_iseq.rb
===================================================================
--- test/ruby/test_iseq.rb	(revision 43872)
+++ test/ruby/test_iseq.rb	(revision 43873)
@@ -121,9 +121,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L121
     c = Class.new{ def foobar() end }
 
     a, b = eval("# encoding: us-ascii\n'foobar'.freeze"),
-      ISeq.of(c.instance_method(:foobar)).label
-
-    assert_equal a.object_id, b.object_id,
-      "#{a.inspect}.object_id != #{b.inspect}.object_id"
+           ISeq.of(c.instance_method(:foobar)).label
+    assert_same a, b
   end
 end
Index: test/ruby/test_hash.rb
===================================================================
--- test/ruby/test_hash.rb	(revision 43872)
+++ test/ruby/test_hash.rb	(revision 43873)
@@ -212,7 +212,7 @@ class TestHash < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L212
   def test_ASET_string
     a = {"ABC" => :t}
     b = {"ABC" => :t}
-    assert_equal a.keys[0].object_id, b.keys[0].object_id
+    assert_same a.keys[0], b.keys[0]
   end
 
   def test_EQUAL # '=='

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

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