test/unitwise/atom_test.rb in unitwise-0.2.1 vs test/unitwise/atom_test.rb in unitwise-0.2.2
- old
+ new
@@ -21,15 +21,16 @@
subject.find("m").must_be_instance_of Unitwise::Atom
subject.find("V").must_be_instance_of Unitwise::Atom
end
end
- let(:second) { Unitwise::Atom.find("s") }
- let(:yard) { Unitwise::Atom.find("[yd_i]")}
- let(:pi) { Unitwise::Atom.find("[pi]")}
+ let(:second) { Unitwise::Atom.find("s") }
+ let(:yard) { Unitwise::Atom.find("[yd_i]")}
+ let(:pi) { Unitwise::Atom.find("[pi]")}
let(:celsius) { Unitwise::Atom.find("Cel")}
- let(:pfu) { Unitwise::Atom.find("[PFU]")}
+ let(:pfu) { Unitwise::Atom.find("[PFU]")}
+ let(:joule) { Unitwise::Atom.find("J")}
describe "#scale" do
it "must be nil for base atoms" do
second.scale.must_equal nil
end
it "sould be a Scale object for derived atoms" do
@@ -104,14 +105,14 @@
yard.scalar.must_equal 0.9144000000000001
pi.scalar.must_equal 3.141592653589793
end
end
- describe "#key" do
- it "must return the dim or the property" do
- second.key.must_equal "T"
- pi.key.must_equal "number"
- celsius.key.must_equal "temperature"
+ describe "#dim" do
+ it "must return the dim" do
+ second.dim.must_equal 'T'
+ yard.dim.must_equal 'L'
+ joule.dim.must_equal 'L2.M.T-2'
end
end
describe "#measurement=" do
it "must create a new measurement object and set attributes" do
\ No newline at end of file