counter_cachier 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ module CounterCachier
16
16
  cachier = @cachier
17
17
 
18
18
  @klass.send :define_method, @name do
19
- CounterCachier.read(self, name)
19
+ CounterCachier.read(self, cachier)
20
20
  end
21
21
 
22
22
  @klass.send :define_method, "recalc_#{@name}" do
@@ -1,3 +1,3 @@
1
1
  module CounterCachier
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -43,5 +43,15 @@ describe CounterCachier::Mounter do
43
43
  CounterCachier.redis.should_receive :set
44
44
  dummy.recalc_foo.should == 10
45
45
  end
46
+
47
+ it "should properly read the object" do
48
+ CounterCachier.redis.should_receive(:get).and_return(4)
49
+ dummy.foo.should == 4
50
+ end
51
+
52
+ it "should properly read the object" do
53
+ CounterCachier.should_receive(:read).with(dummy, Dummy.cachiers[:foo].cachier)
54
+ dummy.foo
55
+ end
46
56
  end
47
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counter_cachier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: