featurer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/featurer/adapters/redis.rb +2 -1
- data/lib/featurer/version.rb +1 -1
- data/spec/lib/featurer/adapters/redis_spec.rb +34 -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: 229df6bdbec627a7618b56cab5bfde8771c28689
|
4
|
+
data.tar.gz: 14aca1cb4f1eb24914320f5471024e5031c450ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb0799b3aee303df9d5a1bc95ad261435f9dbeb2431a90dd3bc3a258f5df21fdfe09b13f13fcc9eb157326e4b83d65122f8e0d3db8089b2a20327f87ea0fde4
|
7
|
+
data.tar.gz: 0774e3c0335f70e605e327e591cf7caf55c9b086edc93ad3193b3d59a9663ab6b7415f7052803181631f1f630c8c49295158c56c4ded6706b873e3edb7a9158a
|
data/lib/featurer/version.rb
CHANGED
@@ -75,4 +75,38 @@ describe Featurer::RedisAdapter do
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
78
|
+
|
79
|
+
describe '#register' do
|
80
|
+
shared_examples 'rejected feature' do
|
81
|
+
it "doesn't register the feature" do
|
82
|
+
expect(subject).not_to receive(:delete)
|
83
|
+
expect(subject).not_to receive(:save_set)
|
84
|
+
|
85
|
+
subject.register(feature)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'feature name is not empty' do
|
90
|
+
let(:feature) { 'awesome_feature' }
|
91
|
+
|
92
|
+
it 'registers the feature' do
|
93
|
+
expect(subject).to receive(:delete).with(feature)
|
94
|
+
expect(subject).to receive(:save_set).with(feature, true)
|
95
|
+
|
96
|
+
subject.register(feature)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
context 'feature name is empty' do
|
101
|
+
let(:feature) { '' }
|
102
|
+
|
103
|
+
it_behaves_like 'rejected feature'
|
104
|
+
end
|
105
|
+
|
106
|
+
context 'feature name is nil' do
|
107
|
+
let(:feature) { nil }
|
108
|
+
|
109
|
+
it_behaves_like 'rejected feature'
|
110
|
+
end
|
111
|
+
end
|
78
112
|
end
|