Skip to content

Commit

Permalink
Merge pull request #1 from potloc/POT-7606-setter-returns-passed-value
Browse files Browse the repository at this point in the history
POT-7606 Setter returns passed value
  • Loading branch information
thibaultcouraud authored Nov 16, 2021
2 parents 255bb02 + 45e2bf1 commit 501c3fb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## [0.1.0] - 2021-09-29
## [0.2.0] - 2021-11-16

- 1faf6da Bump version to 0.2.0
- f3fe257 Bump version to 0.1.2
- dc73659 Setter returns passed value

## [0.1.1] - 2021-09-29

- ebbcda8 Update Gemfile.lock
- d07268d Bump version
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
potlock (0.1.1)
potlock (0.2.0)
redlock (~> 1.2)

GEM
Expand Down
1 change: 1 addition & 0 deletions lib/potlock/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def get
def set(&block)
value = lock!(&block)
redis.set(key, value)
value
rescue Redlock::LockError => _e
raise Potlock::LockError
end
Expand Down
2 changes: 1 addition & 1 deletion lib/potlock/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Potlock
VERSION = "0.1.1"
VERSION = "0.2.0"
end
4 changes: 4 additions & 0 deletions spec/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
end

describe "#set" do
it "returns the passed value" do
expect(subject.set { "RESPONSE" }).to eq("RESPONSE")
end

context "given a free lock" do
it "stores value in Redis" do
expect(redis.get(key)).to be_nil
Expand Down

0 comments on commit 501c3fb

Please sign in to comment.