spec/array_spec.rb in rico-0.4.0 vs spec/array_spec.rb in rico-0.5.0
- old
+ new
@@ -95,9 +95,16 @@
end.should_not raise_error
end
end
describe "#members" do
+ it "asserts value type as array" do
+ a = Rico::Map.new RiakHelpers.bucket, "array_members_assert_type"
+ a.add({"a" => 1})
+ b = Rico::Array.new RiakHelpers.bucket, "array_members_assert_type"
+ lambda { b.members }.should raise_error(TypeError)
+ end
+
it "returns a list of members" do
a = Rico::Array.new RiakHelpers.bucket, "array_members_lists"
a.add [{"usd" => 123.41, "cad" => 61.89}, "Bears", "Beets", "Battlestar Galactica", 3.14159, 71]
b = Rico::Array.new RiakHelpers.bucket, "array_members_lists"
b.members.should eql [{"usd" => 123.41, "cad" => 61.89}, "Bears", "Beets", "Battlestar Galactica", 3.14159, 71]