Skip to content
Browse files

convert clone test to spec

  • Loading branch information...
1 parent e327128 commit 0296164bdd260f4a74f6ab5bed86d434f9d687df @olbrich committed Feb 1, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −0 spec/ruby-units/unit_spec.rb
  2. +0 −8 test/test_ruby-units.rb
View
4 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
View
8 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

0 comments on commit 0296164

Please sign in to comment.
Something went wrong with that request. Please try again.