-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
201d842
commit a84761e
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require_relative "test_helper" | ||
|
||
describe "gets" do | ||
it "can get cas unique" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, value: "test" | ||
expect_gets client, value: "test", cas_unique: 1 | ||
end | ||
end | ||
|
||
it "returns same cas unique when not changed" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, value: "test" | ||
expect_gets client, value: "test", cas_unique: 1 | ||
expect_gets client, value: "test", cas_unique: 1 | ||
end | ||
end | ||
|
||
it "returns another cas unique when changed" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, value: "test1" | ||
expect_gets client, value: "test1", cas_unique: 1 | ||
expect_set client, value: "test2" | ||
expect_gets client, value: "test2", cas_unique: 2 | ||
end | ||
end | ||
|
||
it "returns another cas unique by each keys" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, key: "test1", value: "test1" | ||
expect_gets client, key: "test1", value: "test1", cas_unique: 1 | ||
expect_set client, key: "test2", value: "test2" | ||
expect_gets client, key: "test2", value: "test2", cas_unique: 2 | ||
end | ||
end | ||
|
||
it "can get many keys at once" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, key: "test1", value: "test1" | ||
expect_set client, key: "test2", value: "test2" | ||
expect_get_many client, { | ||
"test1" => {value: "test1", cas_unique: 1}, | ||
"test2" => {value: "test2", cas_unique: 2}, | ||
} | ||
end | ||
end | ||
|
||
it "can get flags" do | ||
with_bashcached_and_client do |client| | ||
expect_set client, value: "test", flags: 42 | ||
expect_gets client, value: "test", flags: 42, cas_unique: 1 | ||
end | ||
end | ||
end |