spec/lib/backends/redis_spec.rb in rector-0.0.2 vs spec/lib/backends/redis_spec.rb in rector-0.0.3
- old
+ new
@@ -21,11 +21,12 @@
hsh = {
"foo" => 1,
"bar" => 2
}
- redis.expects(:sadd).with("#{job_id}:__keys__", ["foo", "bar"])
+ redis.expects(:sadd).with("#{job_id}:__keys__", "foo")
+ redis.expects(:sadd).with("#{job_id}:__keys__", "bar")
subject.update_job_data_from_hash(hsh)
end
it "stores integers" do
hsh = { "foo" => 1 }
@@ -35,17 +36,21 @@
end
it "stores lists" do
hsh = { "foo" => ["a", "b", "c"] }
- redis.expects(:rpush).with("#{job_id}:foo", ["a", "b", "c"])
+ redis.expects(:rpush).with("#{job_id}:foo", "a")
+ redis.expects(:rpush).with("#{job_id}:foo", "b")
+ redis.expects(:rpush).with("#{job_id}:foo", "c")
subject.update_job_data_from_hash(hsh)
end
it "stores sets" do
hsh = { "foo" => Set.new(["a", "b", "c"]) }
- redis.expects(:sadd).with("#{job_id}:foo", ["a", "b", "c"])
+ redis.expects(:sadd).with("#{job_id}:foo", "a")
+ redis.expects(:sadd).with("#{job_id}:foo", "b")
+ redis.expects(:sadd).with("#{job_id}:foo", "c")
subject.update_job_data_from_hash(hsh)
end
end
describe "reading" do