spec/monetaspecs.rb in moneta-0.7.4 vs spec/monetaspecs.rb in moneta-0.7.5

- old
+ new

@@ -1,6 +1,6 @@ -# Generated by generate-specs.rb +# Generated by generate-specs #################### null_nilkey_nilvalue #################### shared_examples_for 'null_nilkey_nilvalue' do it 'reads from keys like a Hash' do @@ -1719,33 +1719,61 @@ #################### returndifferent_nilkey_stringvalue #################### shared_examples_for 'returndifferent_nilkey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store[0] = "strval1" - store[0].should_not be_equal("strval1") + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store[nil] = "strval1" - store[nil].should_not be_equal("strval1") + store[nil] = value + store[nil].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[0] = "strval2" - store[0].should_not be_equal("strval2") + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[nil] = "strval2" - store[nil].should_not be_equal("strval2") + store[nil] = value + store[nil].should_not be_equal(value) end end +#################### returnsame_nilkey_stringvalue #################### + +shared_examples_for 'returnsame_nilkey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[nil] = value + store[nil].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[nil] = value + store[nil].should be_equal(value) + end +end + #################### persist_nilkey_stringvalue #################### shared_examples_for 'persist_nilkey_stringvalue' do it 'persists values' do store[0] = "strval1" @@ -2195,33 +2223,61 @@ #################### returndifferent_nilkey_hashvalue #################### shared_examples_for 'returndifferent_nilkey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[0] = {"hashval1"=>["array1", 1]} - store[0].should_not be_equal({"hashval1"=>["array1", 1]}) + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[nil] = {"hashval1"=>["array1", 1]} - store[nil].should_not be_equal({"hashval1"=>["array1", 1]}) + store[nil] = value + store[nil].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[0] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[0].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[nil] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[nil].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[nil] = value + store[nil].should_not be_equal(value) end end +#################### returnsame_nilkey_hashvalue #################### + +shared_examples_for 'returnsame_nilkey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[nil] = value + store[nil].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[nil] = value + store[nil].should be_equal(value) + end +end + #################### persist_nilkey_hashvalue #################### shared_examples_for 'persist_nilkey_hashvalue' do it 'persists values' do store[0] = {"hashval1"=>["array1", 1]} @@ -2671,33 +2727,61 @@ #################### returndifferent_nilkey_objectvalue #################### shared_examples_for 'returndifferent_nilkey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[0] = Value.new(:objval1) - store[0].should_not be_equal(Value.new(:objval1)) + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[nil] = Value.new(:objval1) - store[nil].should_not be_equal(Value.new(:objval1)) + store[nil] = value + store[nil].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[0] = Value.new(:objval2) - store[0].should_not be_equal(Value.new(:objval2)) + store[0] = value + store[0].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[nil] = Value.new(:objval2) - store[nil].should_not be_equal(Value.new(:objval2)) + store[nil] = value + store[nil].should_not be_equal(value) end end +#################### returnsame_nilkey_objectvalue #################### + +shared_examples_for 'returnsame_nilkey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[nil] = value + store[nil].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[0] = value + store[0].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[nil] = value + store[nil].should be_equal(value) + end +end + #################### persist_nilkey_objectvalue #################### shared_examples_for 'persist_nilkey_objectvalue' do it 'persists values' do store[0] = Value.new(:objval1) @@ -4447,33 +4531,61 @@ #################### returndifferent_integerkey_stringvalue #################### shared_examples_for 'returndifferent_integerkey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store[-10] = "strval1" - store[-10].should_not be_equal("strval1") + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store[42] = "strval1" - store[42].should_not be_equal("strval1") + store[42] = value + store[42].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[-10] = "strval2" - store[-10].should_not be_equal("strval2") + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[42] = "strval2" - store[42].should_not be_equal("strval2") + store[42] = value + store[42].should_not be_equal(value) end end +#################### returnsame_integerkey_stringvalue #################### + +shared_examples_for 'returnsame_integerkey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[42] = value + store[42].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[42] = value + store[42].should be_equal(value) + end +end + #################### persist_integerkey_stringvalue #################### shared_examples_for 'persist_integerkey_stringvalue' do it 'persists values' do store[-10] = "strval1" @@ -4923,33 +5035,61 @@ #################### returndifferent_integerkey_hashvalue #################### shared_examples_for 'returndifferent_integerkey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[-10] = {"hashval1"=>["array1", 1]} - store[-10].should_not be_equal({"hashval1"=>["array1", 1]}) + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[42] = {"hashval1"=>["array1", 1]} - store[42].should_not be_equal({"hashval1"=>["array1", 1]}) + store[42] = value + store[42].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[-10] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[-10].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[42] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[42].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[42] = value + store[42].should_not be_equal(value) end end +#################### returnsame_integerkey_hashvalue #################### + +shared_examples_for 'returnsame_integerkey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[42] = value + store[42].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[42] = value + store[42].should be_equal(value) + end +end + #################### persist_integerkey_hashvalue #################### shared_examples_for 'persist_integerkey_hashvalue' do it 'persists values' do store[-10] = {"hashval1"=>["array1", 1]} @@ -5399,33 +5539,61 @@ #################### returndifferent_integerkey_objectvalue #################### shared_examples_for 'returndifferent_integerkey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[-10] = Value.new(:objval1) - store[-10].should_not be_equal(Value.new(:objval1)) + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[42] = Value.new(:objval1) - store[42].should_not be_equal(Value.new(:objval1)) + store[42] = value + store[42].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[-10] = Value.new(:objval2) - store[-10].should_not be_equal(Value.new(:objval2)) + store[-10] = value + store[-10].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[42] = Value.new(:objval2) - store[42].should_not be_equal(Value.new(:objval2)) + store[42] = value + store[42].should_not be_equal(value) end end +#################### returnsame_integerkey_objectvalue #################### + +shared_examples_for 'returnsame_integerkey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[42] = value + store[42].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[-10] = value + store[-10].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[42] = value + store[42].should be_equal(value) + end +end + #################### persist_integerkey_objectvalue #################### shared_examples_for 'persist_integerkey_objectvalue' do it 'persists values' do store[-10] = Value.new(:objval1) @@ -7175,33 +7343,61 @@ #################### returndifferent_booleankey_stringvalue #################### shared_examples_for 'returndifferent_booleankey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store[true] = "strval1" - store[true].should_not be_equal("strval1") + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store[false] = "strval1" - store[false].should_not be_equal("strval1") + store[false] = value + store[false].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[true] = "strval2" - store[true].should_not be_equal("strval2") + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[false] = "strval2" - store[false].should_not be_equal("strval2") + store[false] = value + store[false].should_not be_equal(value) end end +#################### returnsame_booleankey_stringvalue #################### + +shared_examples_for 'returnsame_booleankey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[false] = value + store[false].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[false] = value + store[false].should be_equal(value) + end +end + #################### persist_booleankey_stringvalue #################### shared_examples_for 'persist_booleankey_stringvalue' do it 'persists values' do store[true] = "strval1" @@ -7651,33 +7847,61 @@ #################### returndifferent_booleankey_hashvalue #################### shared_examples_for 'returndifferent_booleankey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[true] = {"hashval1"=>["array1", 1]} - store[true].should_not be_equal({"hashval1"=>["array1", 1]}) + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[false] = {"hashval1"=>["array1", 1]} - store[false].should_not be_equal({"hashval1"=>["array1", 1]}) + store[false] = value + store[false].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[true] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[true].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[false] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[false].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[false] = value + store[false].should_not be_equal(value) end end +#################### returnsame_booleankey_hashvalue #################### + +shared_examples_for 'returnsame_booleankey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[false] = value + store[false].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[false] = value + store[false].should be_equal(value) + end +end + #################### persist_booleankey_hashvalue #################### shared_examples_for 'persist_booleankey_hashvalue' do it 'persists values' do store[true] = {"hashval1"=>["array1", 1]} @@ -8127,33 +8351,61 @@ #################### returndifferent_booleankey_objectvalue #################### shared_examples_for 'returndifferent_booleankey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[true] = Value.new(:objval1) - store[true].should_not be_equal(Value.new(:objval1)) + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[false] = Value.new(:objval1) - store[false].should_not be_equal(Value.new(:objval1)) + store[false] = value + store[false].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[true] = Value.new(:objval2) - store[true].should_not be_equal(Value.new(:objval2)) + store[true] = value + store[true].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[false] = Value.new(:objval2) - store[false].should_not be_equal(Value.new(:objval2)) + store[false] = value + store[false].should_not be_equal(value) end end +#################### returnsame_booleankey_objectvalue #################### + +shared_examples_for 'returnsame_booleankey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[false] = value + store[false].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[true] = value + store[true].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[false] = value + store[false].should be_equal(value) + end +end + #################### persist_booleankey_objectvalue #################### shared_examples_for 'persist_booleankey_objectvalue' do it 'persists values' do store[true] = Value.new(:objval1) @@ -9903,33 +10155,61 @@ #################### returndifferent_stringkey_stringvalue #################### shared_examples_for 'returndifferent_stringkey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store["strkey1"] = "strval1" - store["strkey1"].should_not be_equal("strval1") + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store["strkey2"] = "strval1" - store["strkey2"].should_not be_equal("strval1") + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store["strkey1"] = "strval2" - store["strkey1"].should_not be_equal("strval2") + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store["strkey2"] = "strval2" - store["strkey2"].should_not be_equal("strval2") + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end end +#################### returnsame_stringkey_stringvalue #################### + +shared_examples_for 'returnsame_stringkey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end +end + #################### persist_stringkey_stringvalue #################### shared_examples_for 'persist_stringkey_stringvalue' do it 'persists values' do store["strkey1"] = "strval1" @@ -10379,33 +10659,61 @@ #################### returndifferent_stringkey_hashvalue #################### shared_examples_for 'returndifferent_stringkey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store["strkey1"] = {"hashval1"=>["array1", 1]} - store["strkey1"].should_not be_equal({"hashval1"=>["array1", 1]}) + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store["strkey2"] = {"hashval1"=>["array1", 1]} - store["strkey2"].should_not be_equal({"hashval1"=>["array1", 1]}) + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store["strkey1"] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store["strkey1"].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store["strkey2"] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store["strkey2"].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end end +#################### returnsame_stringkey_hashvalue #################### + +shared_examples_for 'returnsame_stringkey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end +end + #################### persist_stringkey_hashvalue #################### shared_examples_for 'persist_stringkey_hashvalue' do it 'persists values' do store["strkey1"] = {"hashval1"=>["array1", 1]} @@ -10855,33 +11163,61 @@ #################### returndifferent_stringkey_objectvalue #################### shared_examples_for 'returndifferent_stringkey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store["strkey1"] = Value.new(:objval1) - store["strkey1"].should_not be_equal(Value.new(:objval1)) + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store["strkey2"] = Value.new(:objval1) - store["strkey2"].should_not be_equal(Value.new(:objval1)) + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store["strkey1"] = Value.new(:objval2) - store["strkey1"].should_not be_equal(Value.new(:objval2)) + store["strkey1"] = value + store["strkey1"].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store["strkey2"] = Value.new(:objval2) - store["strkey2"].should_not be_equal(Value.new(:objval2)) + store["strkey2"] = value + store["strkey2"].should_not be_equal(value) end end +#################### returnsame_stringkey_objectvalue #################### + +shared_examples_for 'returnsame_stringkey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store["strkey1"] = value + store["strkey1"].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store["strkey2"] = value + store["strkey2"].should be_equal(value) + end +end + #################### persist_stringkey_objectvalue #################### shared_examples_for 'persist_stringkey_objectvalue' do it 'persists values' do store["strkey1"] = Value.new(:objval1) @@ -12631,33 +12967,61 @@ #################### returndifferent_objectkey_stringvalue #################### shared_examples_for 'returndifferent_objectkey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store[Value.new(:objkey1)] = "strval1" - store[Value.new(:objkey1)].should_not be_equal("strval1") + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store[Value.new(:objkey2)] = "strval1" - store[Value.new(:objkey2)].should_not be_equal("strval1") + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[Value.new(:objkey1)] = "strval2" - store[Value.new(:objkey1)].should_not be_equal("strval2") + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[Value.new(:objkey2)] = "strval2" - store[Value.new(:objkey2)].should_not be_equal("strval2") + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end end +#################### returnsame_objectkey_stringvalue #################### + +shared_examples_for 'returnsame_objectkey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end +end + #################### persist_objectkey_stringvalue #################### shared_examples_for 'persist_objectkey_stringvalue' do it 'persists values' do store[Value.new(:objkey1)] = "strval1" @@ -13107,33 +13471,61 @@ #################### returndifferent_objectkey_hashvalue #################### shared_examples_for 'returndifferent_objectkey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[Value.new(:objkey1)] = {"hashval1"=>["array1", 1]} - store[Value.new(:objkey1)].should_not be_equal({"hashval1"=>["array1", 1]}) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[Value.new(:objkey2)] = {"hashval1"=>["array1", 1]} - store[Value.new(:objkey2)].should_not be_equal({"hashval1"=>["array1", 1]}) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[Value.new(:objkey1)] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[Value.new(:objkey1)].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[Value.new(:objkey2)] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[Value.new(:objkey2)].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end end +#################### returnsame_objectkey_hashvalue #################### + +shared_examples_for 'returnsame_objectkey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end +end + #################### persist_objectkey_hashvalue #################### shared_examples_for 'persist_objectkey_hashvalue' do it 'persists values' do store[Value.new(:objkey1)] = {"hashval1"=>["array1", 1]} @@ -13583,33 +13975,61 @@ #################### returndifferent_objectkey_objectvalue #################### shared_examples_for 'returndifferent_objectkey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[Value.new(:objkey1)] = Value.new(:objval1) - store[Value.new(:objkey1)].should_not be_equal(Value.new(:objval1)) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[Value.new(:objkey2)] = Value.new(:objval1) - store[Value.new(:objkey2)].should_not be_equal(Value.new(:objval1)) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[Value.new(:objkey1)] = Value.new(:objval2) - store[Value.new(:objkey1)].should_not be_equal(Value.new(:objval2)) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[Value.new(:objkey2)] = Value.new(:objval2) - store[Value.new(:objkey2)].should_not be_equal(Value.new(:objval2)) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should_not be_equal(value) end end +#################### returnsame_objectkey_objectvalue #################### + +shared_examples_for 'returnsame_objectkey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[Value.new(:objkey1)] = value + store[Value.new(:objkey1)].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[Value.new(:objkey2)] = value + store[Value.new(:objkey2)].should be_equal(value) + end +end + #################### persist_objectkey_objectvalue #################### shared_examples_for 'persist_objectkey_objectvalue' do it 'persists values' do store[Value.new(:objkey1)] = Value.new(:objval1) @@ -15359,33 +15779,61 @@ #################### returndifferent_hashkey_stringvalue #################### shared_examples_for 'returndifferent_hashkey_stringvalue' do it 'guarantees that a different value is retrieved' do value = "strval1" - store[{"hashkey1"=>"hashkey2"}] = "strval1" - store[{"hashkey1"=>"hashkey2"}].should_not be_equal("strval1") + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval1" - store[{"hashkey3"=>"hashkey4"}] = "strval1" - store[{"hashkey3"=>"hashkey4"}].should_not be_equal("strval1") + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[{"hashkey1"=>"hashkey2"}] = "strval2" - store[{"hashkey1"=>"hashkey2"}].should_not be_equal("strval2") + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = "strval2" - store[{"hashkey3"=>"hashkey4"}] = "strval2" - store[{"hashkey3"=>"hashkey4"}].should_not be_equal("strval2") + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end end +#################### returnsame_hashkey_stringvalue #################### + +shared_examples_for 'returnsame_hashkey_stringvalue' do + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval1" + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = "strval2" + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end +end + #################### persist_hashkey_stringvalue #################### shared_examples_for 'persist_hashkey_stringvalue' do it 'persists values' do store[{"hashkey1"=>"hashkey2"}] = "strval1" @@ -15835,33 +16283,61 @@ #################### returndifferent_hashkey_hashvalue #################### shared_examples_for 'returndifferent_hashkey_hashvalue' do it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[{"hashkey1"=>"hashkey2"}] = {"hashval1"=>["array1", 1]} - store[{"hashkey1"=>"hashkey2"}].should_not be_equal({"hashval1"=>["array1", 1]}) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval1"=>["array1", 1]} - store[{"hashkey3"=>"hashkey4"}] = {"hashval1"=>["array1", 1]} - store[{"hashkey3"=>"hashkey4"}].should_not be_equal({"hashval1"=>["array1", 1]}) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[{"hashkey1"=>"hashkey2"}] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[{"hashkey1"=>"hashkey2"}].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[{"hashkey3"=>"hashkey4"}] = {"hashval3"=>["array2", {"hashval4"=>42}]} - store[{"hashkey3"=>"hashkey4"}].should_not be_equal({"hashval3"=>["array2", {"hashval4"=>42}]}) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end end +#################### returnsame_hashkey_hashvalue #################### + +shared_examples_for 'returnsame_hashkey_hashvalue' do + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval1"=>["array1", 1]} + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = {"hashval3"=>["array2", {"hashval4"=>42}]} + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end +end + #################### persist_hashkey_hashvalue #################### shared_examples_for 'persist_hashkey_hashvalue' do it 'persists values' do store[{"hashkey1"=>"hashkey2"}] = {"hashval1"=>["array1", 1]} @@ -16311,33 +16787,61 @@ #################### returndifferent_hashkey_objectvalue #################### shared_examples_for 'returndifferent_hashkey_objectvalue' do it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[{"hashkey1"=>"hashkey2"}] = Value.new(:objval1) - store[{"hashkey1"=>"hashkey2"}].should_not be_equal(Value.new(:objval1)) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval1) - store[{"hashkey3"=>"hashkey4"}] = Value.new(:objval1) - store[{"hashkey3"=>"hashkey4"}].should_not be_equal(Value.new(:objval1)) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[{"hashkey1"=>"hashkey2"}] = Value.new(:objval2) - store[{"hashkey1"=>"hashkey2"}].should_not be_equal(Value.new(:objval2)) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should_not be_equal(value) end it 'guarantees that a different value is retrieved' do value = Value.new(:objval2) - store[{"hashkey3"=>"hashkey4"}] = Value.new(:objval2) - store[{"hashkey3"=>"hashkey4"}].should_not be_equal(Value.new(:objval2)) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should_not be_equal(value) end end +#################### returnsame_hashkey_objectvalue #################### + +shared_examples_for 'returnsame_hashkey_objectvalue' do + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval1) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[{"hashkey1"=>"hashkey2"}] = value + store[{"hashkey1"=>"hashkey2"}].should be_equal(value) + end + + it 'guarantees that the same value is retrieved' do + value = Value.new(:objval2) + store[{"hashkey3"=>"hashkey4"}] = value + store[{"hashkey3"=>"hashkey4"}].should be_equal(value) + end +end + #################### persist_hashkey_objectvalue #################### shared_examples_for 'persist_hashkey_objectvalue' do it 'persists values' do store[{"hashkey1"=>"hashkey2"}] = Value.new(:objval1) @@ -16428,13 +16932,13 @@ store.store('key2', 'val2', :expires => 2) store['key2'].should == 'val2' sleep 1 store.load('key2', :expires => 3).should == 'val2' store['key2'].should == 'val2' - sleep 1 + sleep 2 store['key2'].should == 'val2' - sleep 3 + sleep 2 store['key2'].should be_nil end it 'supports 0 as no-expires in load' do store.store('key1', 'val1', :expires => 2) @@ -16454,13 +16958,13 @@ store.store('key2', 'val2', :expires => 2) store['key2'].should == 'val2' sleep 1 store.key?('key2', :expires => 3).should be_true store['key2'].should == 'val2' - sleep 1 + sleep 2 store['key2'].should == 'val2' - sleep 3 + sleep 2 store['key2'].should be_nil end it 'supports 0 as no-expires in key?' do store.store('key1', 'val1', :expires => 2) @@ -16480,12 +16984,12 @@ store.store('key1', 'val1', :expires => 2) store['key1'].should == 'val1' sleep 1 store.fetch('key1', nil, :expires => 3).should == 'val1' store['key1'].should == 'val1' - sleep 1 + sleep 2 store['key1'].should == 'val1' - sleep 3 + sleep 2 store['key1'].should be_nil end it 'supports 0 as no-expires in fetch' do store.store('key1', 'val1', :expires => 2)