test/unitwise_test.rb in unitwise-0.10.0 vs test/unitwise_test.rb in unitwise-1.0.0
- old
+ new
@@ -3,11 +3,14 @@
describe Unitwise do
describe '()' do
it "should accept a number and string" do
Unitwise(2, 'm/s').must_be_instance_of Unitwise::Measurement
end
- it "should accept a lonely string" do
- Unitwise('kg').must_be_instance_of Unitwise::Measurement
+ it "should accept a measurement and a string" do
+ mass = Unitwise(1, "lb")
+ new_mass = Unitwise(mass, "kg")
+ new_mass.value.must_equal(0.45359237)
+ new_mass.unit.to_s.must_equal("kg")
end
end
describe 'search' do
it "must return results" do