Skip to content

Commit

Permalink
convert clone test to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
olbrich committed Feb 2, 2012
1 parent e327128 commit 0296164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions spec/ruby-units/unit_spec.rb
Expand Up @@ -627,6 +627,10 @@

end

describe '#clone' do
subject { Unit('1 mm') }
its(:clone) {should === subject}
end
end

describe "Unit Comparisons" do
Expand Down
8 changes: 0 additions & 8 deletions test/test_ruby-units.rb
Expand Up @@ -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
Expand Down

0 comments on commit 0296164

Please sign in to comment.