spec/parsers/number_parser_spec.rb in fonte-0.1.0 vs spec/parsers/number_parser_spec.rb in fonte-0.2.0
- old
+ new
@@ -73,8 +73,25 @@
let(:number) { "2.2E-4" }
it { should == 0.00022 }
end
end
end
+
+ describe "coordinates" do
+ context "only integers" do
+ let(:number) { "10 10 20" }
+ it { should == [10, 10, 20] }
+ end
+
+ context "only floats" do
+ let(:number) { "3617.36 -1739.69 294.53" }
+ it { should == [3617.36, -1739.69, 294.53] }
+ end
+
+ context "mixing integers and floats" do
+ let(:number) { "3617.36 -1739 294.53" }
+ it { should == [3617.36, -1739, 294.53] }
+ end
+ end
end
end
end