goalkeeper 0.3.2 → 0.3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/goalkeeper/version.rb +1 -1
- data/lib/goalkeeper.rb +4 -4
- data/test/goalkeeper_test.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd4a0197fd4213c54395dba33011c6d3f0c462f
|
4
|
+
data.tar.gz: 1f924a65dcbf18e9c9e3b7f4318e2583ec5f6bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ba6d96c5126db3a6baec7bd9559967e191ea804c853955eabb611377c9614f35dbee60a75b0386f66d62cf06682f1e1eb7b16b270cf94d2491305439eacf7d9
|
7
|
+
data.tar.gz: 5049b721a6d86acbbd1c82c63787a30c1a84e6d7779f41d48b99653bacd559bd5271a5750b586068dca92f45023af5c9eaf46a1b0c72485450dff088f2abda05
|
data/lib/goalkeeper/version.rb
CHANGED
data/lib/goalkeeper.rb
CHANGED
@@ -85,12 +85,12 @@ module Goalkeeper
|
|
85
85
|
end
|
86
86
|
|
87
87
|
# Creates a persistent Goal market with the given label.
|
88
|
-
def self.met!(label)
|
89
|
-
Goal.new(label).met!
|
88
|
+
def self.met!(*label)
|
89
|
+
Goal.new(*label).met!
|
90
90
|
end
|
91
91
|
|
92
|
-
def self.met?(label)
|
93
|
-
Goal.new(label).met?
|
92
|
+
def self.met?(*label)
|
93
|
+
Goal.new(*label).met?
|
94
94
|
end
|
95
95
|
|
96
96
|
# The TTL set for each met Goal record created in Redis
|
data/test/goalkeeper_test.rb
CHANGED
@@ -28,4 +28,21 @@ describe Goalkeeper do
|
|
28
28
|
Goalkeeper.namespace = ns
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
let(:goal) { Goalkeeper::Goal.new('a:b') }
|
33
|
+
|
34
|
+
describe "::met!" do
|
35
|
+
it "creates a goal and flags it met" do
|
36
|
+
Goalkeeper.met!('a','b')
|
37
|
+
assert goal.met?
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "::met?" do
|
42
|
+
it "creates a goal and checks if it is met" do
|
43
|
+
assert ! Goalkeeper.met?('a','b')
|
44
|
+
goal.met!
|
45
|
+
assert Goalkeeper.met?('a','b')
|
46
|
+
end
|
47
|
+
end
|
31
48
|
end
|