spec/latinum/resource_spec.rb in latinum-0.7.0 vs spec/latinum/resource_spec.rb in latinum-0.7.1
- old
+ new
@@ -34,9 +34,17 @@
it "should load and dump nil correctly" do
expect(Latinum::Resource.load(nil)).to be nil
expect(Latinum::Resource.dump(nil)).to be nil
end
+ it "should handle empty strings correctly" do
+ expect(Latinum::Resource.load("")).to be nil
+ end
+
+ it "should handle whitespace strings correctly" do
+ expect(Latinum::Resource.load(" ")).to be nil
+ end
+
it "should load and dump resources correctly" do
resource = Latinum::Resource.new(10, 'NZD')
expect(Latinum::Resource.load("10.0 NZD")).to be == resource
expect(Latinum::Resource.dump(resource)).to be == "10.0 NZD"