onyx-cache-money 0.2.5.5 → 0.2.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cash/accessor.rb CHANGED
@@ -39,7 +39,7 @@ module Cash
39
39
 
40
40
  def add(key, value, options = {})
41
41
  if repository.add(cache_key(key), value, options[:ttl] || 0, options[:raw]) == "NOT_STORED\r\n"
42
- yield
42
+ yield if block_given?
43
43
  end
44
44
  end
45
45
 
@@ -108,6 +108,11 @@ module Cash
108
108
  Story.set("count", 1)
109
109
  Story.add("count", 1) { "yield me" }.should == "yield me"
110
110
  end
111
+
112
+ it 'yields to the block if block is given' do
113
+ Story.set("count", 1)
114
+ lambda { Story.add("count", 1) }.should_not raise_error(LocalJumpError)
115
+ end
111
116
  end
112
117
 
113
118
  describe 'when the value does not already exist' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onyx-cache-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.5
4
+ version: 0.2.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kallen