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

ruby-changes:15203

From: tenderlove <ko1@a...>
Date: Mon, 29 Mar 2010 13:30:41 +0900 (JST)
Subject: [ruby-changes:15203] Ruby:r27084 (trunk): * test/psych/visitors/test_to_ruby.rb: switching to assert_in_delta

tenderlove	2010-03-29 13:30:30 +0900 (Mon, 29 Mar 2010)

  New Revision: 27084

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

  Log:
    * test/psych/visitors/test_to_ruby.rb: switching to assert_in_delta
    * test/psych/visitors/test_yaml_tree.rb: switching to assert_in_delta

  Modified files:
    trunk/test/psych/visitors/test_to_ruby.rb
    trunk/test/psych/visitors/test_yaml_tree.rb

Index: test/psych/visitors/test_yaml_tree.rb
===================================================================
--- test/psych/visitors/test_yaml_tree.rb	(revision 27083)
+++ test/psych/visitors/test_yaml_tree.rb	(revision 27084)
@@ -45,7 +45,8 @@
       end
 
       def test_time
-        assert_cycle Time.now
+        t = Time.now
+        assert_in_delta t, Psych.load(Psych.dump(t)), 0.000001
       end
 
       def test_date
Index: test/psych/visitors/test_to_ruby.rb
===================================================================
--- test/psych/visitors/test_to_ruby.rb	(revision 27083)
+++ test/psych/visitors/test_to_ruby.rb	(revision 27084)
@@ -115,7 +115,7 @@
         formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
           ".%06d %+.2d:00" % [now.usec, now.gmt_offset / 3600]
 
-        assert_equal now, Nodes::Scalar.new(formatted).to_ruby
+        assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
       end
 
       def test_time_utc
@@ -123,7 +123,7 @@
         formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
           ".%06dZ" % [now.usec]
 
-        assert_equal now, Nodes::Scalar.new(formatted).to_ruby
+        assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
       end
 
       def test_time_utc_no_z
@@ -131,7 +131,7 @@
         formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
           ".%06d" % [now.usec]
 
-        assert_equal now, Nodes::Scalar.new(formatted).to_ruby
+        assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
       end
 
       def test_date

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

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