spec/latinum/collection_spec.rb in latinum-1.0.0 vs spec/latinum/collection_spec.rb in latinum-1.1.0

- old
+ new

@@ -79,7 +79,20 @@ expect(subject["NZD"]).to be == Latinum::Resource.load("20 NZD") expect(subject["AUD"]).to be == Latinum::Resource.load("20 AUD") expect(subject["USD"]).to be == Latinum::Resource.load("20 USD") end + + it "can enumerate resources" do + resources = [ + Latinum::Resource.new("10", "NZD"), + Latinum::Resource.new("10", "AUD"), + Latinum::Resource.new("10", "USD"), + ] + + collection = Latinum::Collection.new + collection << resources + + expect(collection.each.to_a).to be == resources + end end end