From 0296164bdd260f4a74f6ab5bed86d434f9d687df Mon Sep 17 00:00:00 2001 From: Kevin Olbrich Date: Wed, 1 Feb 2012 22:27:34 -0500 Subject: [PATCH] convert clone test to spec --- spec/ruby-units/unit_spec.rb | 4 ++++ test/test_ruby-units.rb | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/spec/ruby-units/unit_spec.rb b/spec/ruby-units/unit_spec.rb index 2d13c50..4f3c3b8 100644 --- a/spec/ruby-units/unit_spec.rb +++ b/spec/ruby-units/unit_spec.rb @@ -627,6 +627,10 @@ end + describe '#clone' do + subject { Unit('1 mm') } + its(:clone) {should === subject} + end end describe "Unit Comparisons" do diff --git a/test/test_ruby-units.rb b/test/test_ruby-units.rb index f2c4d59..04c5a3e 100644 --- a/test/test_ruby-units.rb +++ b/test/test_ruby-units.rb @@ -78,14 +78,6 @@ def teardown DateTime.forced_now = nil end - def test_clone - unit1= "1 mm".unit - unit2 = unit1.clone - assert_not_equal unit1.numerator.object_id, unit2.numerator.object_id - assert_not_equal unit1.denominator.object_id, unit2.denominator.object_id - assert unit1 === unit2 - end - def test_to_unit unit1 = "1 mm".to_unit assert_equal unit1, unit1.to_unit