flipper 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +4 -0
  3. data/Gemfile +1 -1
  4. data/docs/Adapters.md +2 -1
  5. data/examples/enabled_for_actor.rb +43 -0
  6. data/lib/flipper/spec/shared_adapter_specs.rb +71 -71
  7. data/lib/flipper/version.rb +1 -1
  8. data/spec/flipper/adapters/instrumented_spec.rb +44 -44
  9. data/spec/flipper/adapters/memoizable_spec.rb +21 -21
  10. data/spec/flipper/adapters/memory_spec.rb +1 -1
  11. data/spec/flipper/adapters/operation_logger_spec.rb +11 -11
  12. data/spec/flipper/adapters/pstore_spec.rb +2 -2
  13. data/spec/flipper/dsl_spec.rb +34 -34
  14. data/spec/flipper/feature_spec.rb +167 -167
  15. data/spec/flipper/gate_spec.rb +5 -5
  16. data/spec/flipper/gate_values_spec.rb +17 -17
  17. data/spec/flipper/gates/actor_spec.rb +1 -1
  18. data/spec/flipper/gates/boolean_spec.rb +13 -13
  19. data/spec/flipper/gates/group_spec.rb +6 -6
  20. data/spec/flipper/gates/percentage_of_actors_spec.rb +3 -3
  21. data/spec/flipper/gates/percentage_of_time_spec.rb +1 -1
  22. data/spec/flipper/instrumentation/log_subscriber_spec.rb +10 -10
  23. data/spec/flipper/instrumentation/metriks_subscriber_spec.rb +14 -14
  24. data/spec/flipper/instrumentation/statsd_subscriber_spec.rb +5 -3
  25. data/spec/flipper/instrumenters/memory_spec.rb +4 -4
  26. data/spec/flipper/instrumenters/noop_spec.rb +3 -3
  27. data/spec/flipper/middleware/memoizer_spec.rb +8 -8
  28. data/spec/flipper/registry_spec.rb +17 -17
  29. data/spec/flipper/typecast_spec.rb +4 -4
  30. data/spec/flipper/types/actor_spec.rb +14 -14
  31. data/spec/flipper/types/boolean_spec.rb +5 -5
  32. data/spec/flipper/types/group_spec.rb +8 -8
  33. data/spec/flipper/types/percentage_of_actors_spec.rb +1 -1
  34. data/spec/flipper/types/percentage_of_time_spec.rb +1 -1
  35. data/spec/flipper/types/percentage_spec.rb +8 -8
  36. data/spec/flipper_spec.rb +19 -19
  37. data/spec/helper.rb +14 -14
  38. data/spec/integration_spec.rb +80 -80
  39. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 843d4702915781ed5862b1e06ad68f1bbc70edab
4
- data.tar.gz: b3709b9a9bddaee1e6847eca0401f4bbcfe09944
3
+ metadata.gz: ead277793aee2dece9038ca1cdd59ac0607a5cc4
4
+ data.tar.gz: c10127accd784df6b64e54442568e29bd4ddadde
5
5
  SHA512:
6
- metadata.gz: 06713185ad986e260ab2e409f9b995267c938823c8f7a7193ce82e618a753849e813d3a34f5af3100aed44e79d5c2874b1acf9cef09fc588505ecc8f1cf59892
7
- data.tar.gz: f1dab95196ab81477d3eb0e2c667fa36341763417582efc6181a40d5f64f60c24d118fd840a7bde4155b820301a6991e25975c8a88faa8ff4cb495e5946061e4
6
+ metadata.gz: 11dea621bb4989d05bf945de1c006e81029259e1996690aecc9327a879877f73d81813cb12c0f0afd47ecf53a93e6dfc235c6f370c9be0a149d0077f5ecf63c0
7
+ data.tar.gz: 55d930c0fb9031ed9470311805b613e831d610c70d0664338fa0a0e9f008785fa82302380f4dd0dbc3a37d8e019128343769faf5d8d20c4adbb3459370f6f04a
@@ -1,3 +1,7 @@
1
+ ## 0.7.2
2
+
3
+ * Add Flipper::UI.application_breadcrumb_href for setting breadcrumb back to original app from Flipper UI
4
+
1
5
  ## 0.7.1
2
6
 
3
7
  * Fix bug where features with names that match static file routes were incorrectly routing to the file action (https://github.com/jnunemaker/flipper/issues/80)
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gem 'rake', '~> 10.4.2'
10
10
  gem 'metriks', '~> 0.9.9'
11
11
  gem 'shotgun', '~> 0.9'
12
12
  gem 'statsd-ruby', '~> 1.2.1'
13
- gem 'rspec', '~> 2.14'
13
+ gem 'rspec', '~> 3.0'
14
14
  gem 'rack-test', '~> 0.6.3'
15
15
  gem 'activesupport', '~> 4.2.0'
16
16
 
@@ -8,7 +8,8 @@ I plan on supporting the adapters in the flipper repo. Other adapters are welcom
8
8
  * [Redis adapter](https://github.com/jnunemaker/flipper/blob/master/docs/redis)
9
9
  * [Cassanity adapter](https://github.com/jnunemaker/flipper-cassanity)
10
10
  * [Active Record 4 adapter](https://github.com/bgentry/flipper-activerecord)
11
- * [Active Record 3 adapter](https://github.com/jproudman/flipper-activerecord)
11
+ * [Active Record 3 adapter](https://github.com/blueboxjesse/flipper-activerecord)
12
+ * [Consul adapter](https://github.com/gdavison/flipper-consul)
12
13
 
13
14
  The basic API for an adapter is this:
14
15
 
@@ -0,0 +1,43 @@
1
+ require File.expand_path('../example_setup', __FILE__)
2
+
3
+ require 'flipper'
4
+ require 'flipper/adapters/memory'
5
+
6
+ # Some class that represents what will be trying to do something
7
+ class User
8
+ attr_reader :id
9
+
10
+ def initialize(id, admin)
11
+ @id = id
12
+ @admin = admin
13
+ end
14
+
15
+ def admin?
16
+ @admin
17
+ end
18
+
19
+ # Must respond to flipper_id
20
+ alias_method :flipper_id, :id
21
+ end
22
+
23
+ user1 = User.new(1, true)
24
+ user2 = User.new(2, false)
25
+
26
+ # pick an adapter
27
+ adapter = Flipper::Adapters::Memory.new
28
+
29
+ # get a handy dsl instance
30
+ flipper = Flipper.new(adapter)
31
+
32
+ Flipper.register :admins do |actor|
33
+ actor.admin?
34
+ end
35
+
36
+ flipper[:search].enable
37
+ flipper[:stats].enable_actor user1
38
+ flipper[:pro_stats].enable_percentage_of_actors 50
39
+ flipper[:tweets].enable_group :admins
40
+ flipper[:posts].enable_actor user2
41
+
42
+ pp flipper.features.select { |feature| feature.enabled?(user1) }.map(&:name)
43
+ pp flipper.features.select { |feature| feature.enabled?(user2) }.map(&:name)
@@ -27,16 +27,16 @@ shared_examples_for 'a flipper adapter' do
27
27
  end
28
28
 
29
29
  it "has name that is a symbol" do
30
- subject.name.should_not be_nil
31
- subject.name.should be_instance_of(Symbol)
30
+ expect(subject.name).to_not be_nil
31
+ expect(subject.name).to be_instance_of(Symbol)
32
32
  end
33
33
 
34
34
  it "has included the flipper adapter module" do
35
- subject.class.ancestors.should include(Flipper::Adapter)
35
+ expect(subject.class.ancestors).to include(Flipper::Adapter)
36
36
  end
37
37
 
38
38
  it "returns correct default values for the gates if none are enabled" do
39
- subject.get(feature).should eq({
39
+ expect(subject.get(feature)).to eq({
40
40
  :boolean => nil,
41
41
  :groups => Set.new,
42
42
  :actors => Set.new,
@@ -46,28 +46,28 @@ shared_examples_for 'a flipper adapter' do
46
46
  end
47
47
 
48
48
  it "can enable, disable and get value for boolean gate" do
49
- subject.enable(feature, boolean_gate, flipper.boolean).should eq(true)
49
+ expect(subject.enable(feature, boolean_gate, flipper.boolean)).to eq(true)
50
50
 
51
51
  result = subject.get(feature)
52
- result[:boolean].should eq('true')
52
+ expect(result[:boolean]).to eq('true')
53
53
 
54
- subject.disable(feature, boolean_gate, flipper.boolean(false)).should eq(true)
54
+ expect(subject.disable(feature, boolean_gate, flipper.boolean(false))).to eq(true)
55
55
 
56
56
  result = subject.get(feature)
57
- result[:boolean].should eq(nil)
57
+ expect(result[:boolean]).to eq(nil)
58
58
  end
59
59
 
60
60
  it "fully disables all enabled things when boolean gate disabled" do
61
61
  actor_22 = actor_class.new('22')
62
- subject.enable(feature, boolean_gate, flipper.boolean).should eq(true)
63
- subject.enable(feature, group_gate, flipper.group(:admins)).should eq(true)
64
- subject.enable(feature, actor_gate, flipper.actor(actor_22)).should eq(true)
65
- subject.enable(feature, actors_gate, flipper.actors(25)).should eq(true)
66
- subject.enable(feature, time_gate, flipper.time(45)).should eq(true)
62
+ expect(subject.enable(feature, boolean_gate, flipper.boolean)).to eq(true)
63
+ expect(subject.enable(feature, group_gate, flipper.group(:admins))).to eq(true)
64
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_22))).to eq(true)
65
+ expect(subject.enable(feature, actors_gate, flipper.actors(25))).to eq(true)
66
+ expect(subject.enable(feature, time_gate, flipper.time(45))).to eq(true)
67
67
 
68
- subject.disable(feature, boolean_gate, flipper.boolean).should eq(true)
68
+ expect(subject.disable(feature, boolean_gate, flipper.boolean)).to eq(true)
69
69
 
70
- subject.get(feature).should eq({
70
+ expect(subject.get(feature)).to eq({
71
71
  :boolean => nil,
72
72
  :groups => Set.new,
73
73
  :actors => Set.new,
@@ -77,117 +77,117 @@ shared_examples_for 'a flipper adapter' do
77
77
  end
78
78
 
79
79
  it "can enable, disable and get value for group gate" do
80
- subject.enable(feature, group_gate, flipper.group(:admins)).should eq(true)
81
- subject.enable(feature, group_gate, flipper.group(:early_access)).should eq(true)
80
+ expect(subject.enable(feature, group_gate, flipper.group(:admins))).to eq(true)
81
+ expect(subject.enable(feature, group_gate, flipper.group(:early_access))).to eq(true)
82
82
 
83
83
  result = subject.get(feature)
84
- result[:groups].should eq(Set['admins', 'early_access'])
84
+ expect(result[:groups]).to eq(Set['admins', 'early_access'])
85
85
 
86
- subject.disable(feature, group_gate, flipper.group(:early_access)).should eq(true)
86
+ expect(subject.disable(feature, group_gate, flipper.group(:early_access))).to eq(true)
87
87
  result = subject.get(feature)
88
- result[:groups].should eq(Set['admins'])
88
+ expect(result[:groups]).to eq(Set['admins'])
89
89
 
90
- subject.disable(feature, group_gate, flipper.group(:admins)).should eq(true)
90
+ expect(subject.disable(feature, group_gate, flipper.group(:admins))).to eq(true)
91
91
  result = subject.get(feature)
92
- result[:groups].should eq(Set.new)
92
+ expect(result[:groups]).to eq(Set.new)
93
93
  end
94
94
 
95
95
  it "can enable, disable and get value for actor gate" do
96
96
  actor_22 = actor_class.new('22')
97
97
  actor_asdf = actor_class.new('asdf')
98
98
 
99
- subject.enable(feature, actor_gate, flipper.actor(actor_22)).should eq(true)
100
- subject.enable(feature, actor_gate, flipper.actor(actor_asdf)).should eq(true)
99
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_22))).to eq(true)
100
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_asdf))).to eq(true)
101
101
 
102
102
  result = subject.get(feature)
103
- result[:actors].should eq(Set['22', 'asdf'])
103
+ expect(result[:actors]).to eq(Set['22', 'asdf'])
104
104
 
105
- subject.disable(feature, actor_gate, flipper.actor(actor_22)).should eq(true)
105
+ expect(subject.disable(feature, actor_gate, flipper.actor(actor_22))).to eq(true)
106
106
  result = subject.get(feature)
107
- result[:actors].should eq(Set['asdf'])
107
+ expect(result[:actors]).to eq(Set['asdf'])
108
108
 
109
- subject.disable(feature, actor_gate, flipper.actor(actor_asdf)).should eq(true)
109
+ expect(subject.disable(feature, actor_gate, flipper.actor(actor_asdf))).to eq(true)
110
110
  result = subject.get(feature)
111
- result[:actors].should eq(Set.new)
111
+ expect(result[:actors]).to eq(Set.new)
112
112
  end
113
113
 
114
114
  it "can enable, disable and get value for percentage of actors gate" do
115
- subject.enable(feature, actors_gate, flipper.actors(15)).should eq(true)
115
+ expect(subject.enable(feature, actors_gate, flipper.actors(15))).to eq(true)
116
116
  result = subject.get(feature)
117
- result[:percentage_of_actors].should eq('15')
117
+ expect(result[:percentage_of_actors]).to eq('15')
118
118
 
119
- subject.disable(feature, actors_gate, flipper.actors(0)).should eq(true)
119
+ expect(subject.disable(feature, actors_gate, flipper.actors(0))).to eq(true)
120
120
  result = subject.get(feature)
121
- result[:percentage_of_actors].should eq('0')
121
+ expect(result[:percentage_of_actors]).to eq('0')
122
122
  end
123
123
 
124
124
  it "can enable, disable and get value for percentage of time gate" do
125
- subject.enable(feature, time_gate, flipper.time(10)).should eq(true)
125
+ expect(subject.enable(feature, time_gate, flipper.time(10))).to eq(true)
126
126
  result = subject.get(feature)
127
- result[:percentage_of_time].should eq('10')
127
+ expect(result[:percentage_of_time]).to eq('10')
128
128
 
129
- subject.disable(feature, time_gate, flipper.time(0)).should eq(true)
129
+ expect(subject.disable(feature, time_gate, flipper.time(0))).to eq(true)
130
130
  result = subject.get(feature)
131
- result[:percentage_of_time].should eq('0')
131
+ expect(result[:percentage_of_time]).to eq('0')
132
132
  end
133
133
 
134
134
  it "converts boolean value to a string" do
135
- subject.enable(feature, boolean_gate, flipper.boolean).should eq(true)
135
+ expect(subject.enable(feature, boolean_gate, flipper.boolean)).to eq(true)
136
136
  result = subject.get(feature)
137
- result[:boolean].should eq('true')
137
+ expect(result[:boolean]).to eq('true')
138
138
  end
139
139
 
140
140
  it "converts the actor value to a string" do
141
- subject.enable(feature, actor_gate, flipper.actor(actor_class.new(22))).should eq(true)
141
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_class.new(22)))).to eq(true)
142
142
  result = subject.get(feature)
143
- result[:actors].should eq(Set['22'])
143
+ expect(result[:actors]).to eq(Set['22'])
144
144
  end
145
145
 
146
146
  it "converts group value to a string" do
147
- subject.enable(feature, group_gate, flipper.group(:admins)).should eq(true)
147
+ expect(subject.enable(feature, group_gate, flipper.group(:admins))).to eq(true)
148
148
  result = subject.get(feature)
149
- result[:groups].should eq(Set['admins'])
149
+ expect(result[:groups]).to eq(Set['admins'])
150
150
  end
151
151
 
152
152
  it "converts percentage of time integer value to a string" do
153
- subject.enable(feature, time_gate, flipper.time(10)).should eq(true)
153
+ expect(subject.enable(feature, time_gate, flipper.time(10))).to eq(true)
154
154
  result = subject.get(feature)
155
- result[:percentage_of_time].should eq('10')
155
+ expect(result[:percentage_of_time]).to eq('10')
156
156
  end
157
157
 
158
158
  it "converts percentage of actors integer value to a string" do
159
- subject.enable(feature, actors_gate, flipper.actors(10)).should eq(true)
159
+ expect(subject.enable(feature, actors_gate, flipper.actors(10))).to eq(true)
160
160
  result = subject.get(feature)
161
- result[:percentage_of_actors].should eq('10')
161
+ expect(result[:percentage_of_actors]).to eq('10')
162
162
  end
163
163
 
164
164
  it "can add, remove and list known features" do
165
- subject.features.should eq(Set.new)
165
+ expect(subject.features).to eq(Set.new)
166
166
 
167
- subject.add(flipper[:stats]).should eq(true)
168
- subject.features.should eq(Set['stats'])
167
+ expect(subject.add(flipper[:stats])).to eq(true)
168
+ expect(subject.features).to eq(Set['stats'])
169
169
 
170
- subject.add(flipper[:search]).should eq(true)
171
- subject.features.should eq(Set['stats', 'search'])
170
+ expect(subject.add(flipper[:search])).to eq(true)
171
+ expect(subject.features).to eq(Set['stats', 'search'])
172
172
 
173
- subject.remove(flipper[:stats]).should eq(true)
174
- subject.features.should eq(Set['search'])
173
+ expect(subject.remove(flipper[:stats])).to eq(true)
174
+ expect(subject.features).to eq(Set['search'])
175
175
 
176
- subject.remove(flipper[:search]).should eq(true)
177
- subject.features.should eq(Set.new)
176
+ expect(subject.remove(flipper[:search])).to eq(true)
177
+ expect(subject.features).to eq(Set.new)
178
178
  end
179
179
 
180
180
  it "clears all the gate values for the feature on remove" do
181
181
  actor_22 = actor_class.new('22')
182
- subject.enable(feature, boolean_gate, flipper.boolean).should eq(true)
183
- subject.enable(feature, group_gate, flipper.group(:admins)).should eq(true)
184
- subject.enable(feature, actor_gate, flipper.actor(actor_22)).should eq(true)
185
- subject.enable(feature, actors_gate, flipper.actors(25)).should eq(true)
186
- subject.enable(feature, time_gate, flipper.time(45)).should eq(true)
182
+ expect(subject.enable(feature, boolean_gate, flipper.boolean)).to eq(true)
183
+ expect(subject.enable(feature, group_gate, flipper.group(:admins))).to eq(true)
184
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_22))).to eq(true)
185
+ expect(subject.enable(feature, actors_gate, flipper.actors(25))).to eq(true)
186
+ expect(subject.enable(feature, time_gate, flipper.time(45))).to eq(true)
187
187
 
188
- subject.remove(feature).should eq(true)
188
+ expect(subject.remove(feature)).to eq(true)
189
189
 
190
- subject.get(feature).should eq({
190
+ expect(subject.get(feature)).to eq({
191
191
  :boolean => nil,
192
192
  :groups => Set.new,
193
193
  :actors => Set.new,
@@ -198,15 +198,15 @@ shared_examples_for 'a flipper adapter' do
198
198
 
199
199
  it "can clear all the gate values for a feature" do
200
200
  actor_22 = actor_class.new('22')
201
- subject.enable(feature, boolean_gate, flipper.boolean).should eq(true)
202
- subject.enable(feature, group_gate, flipper.group(:admins)).should eq(true)
203
- subject.enable(feature, actor_gate, flipper.actor(actor_22)).should eq(true)
204
- subject.enable(feature, actors_gate, flipper.actors(25)).should eq(true)
205
- subject.enable(feature, time_gate, flipper.time(45)).should eq(true)
201
+ expect(subject.enable(feature, boolean_gate, flipper.boolean)).to eq(true)
202
+ expect(subject.enable(feature, group_gate, flipper.group(:admins))).to eq(true)
203
+ expect(subject.enable(feature, actor_gate, flipper.actor(actor_22))).to eq(true)
204
+ expect(subject.enable(feature, actors_gate, flipper.actors(25))).to eq(true)
205
+ expect(subject.enable(feature, time_gate, flipper.time(45))).to eq(true)
206
206
 
207
- subject.clear(feature).should eq(true)
207
+ expect(subject.clear(feature)).to eq(true)
208
208
 
209
- subject.get(feature).should eq({
209
+ expect(subject.get(feature)).to eq({
210
210
  :boolean => nil,
211
211
  :groups => Set.new,
212
212
  :actors => Set.new,
@@ -216,6 +216,6 @@ shared_examples_for 'a flipper adapter' do
216
216
  end
217
217
 
218
218
  it "does not complain clearing a feature that does not exist in adapter" do
219
- subject.clear(flipper[:stats]).should eq(true)
219
+ expect(subject.clear(flipper[:stats])).to eq(true)
220
220
  end
221
221
  end
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
@@ -4,7 +4,7 @@ require 'flipper/adapters/instrumented'
4
4
  require 'flipper/instrumenters/memory'
5
5
  require 'flipper/spec/shared_adapter_specs'
6
6
 
7
- describe Flipper::Adapters::Instrumented do
7
+ RSpec.describe Flipper::Adapters::Instrumented do
8
8
  let(:instrumenter) { Flipper::Instrumenters::Memory.new }
9
9
  let(:adapter) { Flipper::Adapters::Memory.new }
10
10
  let(:flipper) { Flipper.new(adapter) }
@@ -24,12 +24,12 @@ describe Flipper::Adapters::Instrumented do
24
24
  result = subject.get(feature)
25
25
 
26
26
  event = instrumenter.events.last
27
- event.should_not be_nil
28
- event.name.should eq('adapter_operation.flipper')
29
- event.payload[:operation].should eq(:get)
30
- event.payload[:adapter_name].should eq(:memory)
31
- event.payload[:feature_name].should eq(:stats)
32
- event.payload[:result].should be(result)
27
+ expect(event).not_to be_nil
28
+ expect(event.name).to eq('adapter_operation.flipper')
29
+ expect(event.payload[:operation]).to eq(:get)
30
+ expect(event.payload[:adapter_name]).to eq(:memory)
31
+ expect(event.payload[:feature_name]).to eq(:stats)
32
+ expect(event.payload[:result]).to be(result)
33
33
  end
34
34
  end
35
35
 
@@ -38,13 +38,13 @@ describe Flipper::Adapters::Instrumented do
38
38
  result = subject.enable(feature, gate, thing)
39
39
 
40
40
  event = instrumenter.events.last
41
- event.should_not be_nil
42
- event.name.should eq('adapter_operation.flipper')
43
- event.payload[:operation].should eq(:enable)
44
- event.payload[:adapter_name].should eq(:memory)
45
- event.payload[:feature_name].should eq(:stats)
46
- event.payload[:gate_name].should eq(:percentage_of_actors)
47
- event.payload[:result].should be(result)
41
+ expect(event).not_to be_nil
42
+ expect(event.name).to eq('adapter_operation.flipper')
43
+ expect(event.payload[:operation]).to eq(:enable)
44
+ expect(event.payload[:adapter_name]).to eq(:memory)
45
+ expect(event.payload[:feature_name]).to eq(:stats)
46
+ expect(event.payload[:gate_name]).to eq(:percentage_of_actors)
47
+ expect(event.payload[:result]).to be(result)
48
48
  end
49
49
  end
50
50
 
@@ -53,13 +53,13 @@ describe Flipper::Adapters::Instrumented do
53
53
  result = subject.disable(feature, gate, thing)
54
54
 
55
55
  event = instrumenter.events.last
56
- event.should_not be_nil
57
- event.name.should eq('adapter_operation.flipper')
58
- event.payload[:operation].should eq(:disable)
59
- event.payload[:adapter_name].should eq(:memory)
60
- event.payload[:feature_name].should eq(:stats)
61
- event.payload[:gate_name].should eq(:percentage_of_actors)
62
- event.payload[:result].should be(result)
56
+ expect(event).not_to be_nil
57
+ expect(event.name).to eq('adapter_operation.flipper')
58
+ expect(event.payload[:operation]).to eq(:disable)
59
+ expect(event.payload[:adapter_name]).to eq(:memory)
60
+ expect(event.payload[:feature_name]).to eq(:stats)
61
+ expect(event.payload[:gate_name]).to eq(:percentage_of_actors)
62
+ expect(event.payload[:result]).to be(result)
63
63
  end
64
64
  end
65
65
 
@@ -68,12 +68,12 @@ describe Flipper::Adapters::Instrumented do
68
68
  result = subject.add(feature)
69
69
 
70
70
  event = instrumenter.events.last
71
- event.should_not be_nil
72
- event.name.should eq('adapter_operation.flipper')
73
- event.payload[:operation].should eq(:add)
74
- event.payload[:adapter_name].should eq(:memory)
75
- event.payload[:feature_name].should eq(:stats)
76
- event.payload[:result].should be(result)
71
+ expect(event).not_to be_nil
72
+ expect(event.name).to eq('adapter_operation.flipper')
73
+ expect(event.payload[:operation]).to eq(:add)
74
+ expect(event.payload[:adapter_name]).to eq(:memory)
75
+ expect(event.payload[:feature_name]).to eq(:stats)
76
+ expect(event.payload[:result]).to be(result)
77
77
  end
78
78
  end
79
79
 
@@ -82,12 +82,12 @@ describe Flipper::Adapters::Instrumented do
82
82
  result = subject.remove(feature)
83
83
 
84
84
  event = instrumenter.events.last
85
- event.should_not be_nil
86
- event.name.should eq('adapter_operation.flipper')
87
- event.payload[:operation].should eq(:remove)
88
- event.payload[:adapter_name].should eq(:memory)
89
- event.payload[:feature_name].should eq(:stats)
90
- event.payload[:result].should be(result)
85
+ expect(event).not_to be_nil
86
+ expect(event.name).to eq('adapter_operation.flipper')
87
+ expect(event.payload[:operation]).to eq(:remove)
88
+ expect(event.payload[:adapter_name]).to eq(:memory)
89
+ expect(event.payload[:feature_name]).to eq(:stats)
90
+ expect(event.payload[:result]).to be(result)
91
91
  end
92
92
  end
93
93
 
@@ -96,12 +96,12 @@ describe Flipper::Adapters::Instrumented do
96
96
  result = subject.clear(feature)
97
97
 
98
98
  event = instrumenter.events.last
99
- event.should_not be_nil
100
- event.name.should eq('adapter_operation.flipper')
101
- event.payload[:operation].should eq(:clear)
102
- event.payload[:adapter_name].should eq(:memory)
103
- event.payload[:feature_name].should eq(:stats)
104
- event.payload[:result].should be(result)
99
+ expect(event).not_to be_nil
100
+ expect(event.name).to eq('adapter_operation.flipper')
101
+ expect(event.payload[:operation]).to eq(:clear)
102
+ expect(event.payload[:adapter_name]).to eq(:memory)
103
+ expect(event.payload[:feature_name]).to eq(:stats)
104
+ expect(event.payload[:result]).to be(result)
105
105
  end
106
106
  end
107
107
 
@@ -110,11 +110,11 @@ describe Flipper::Adapters::Instrumented do
110
110
  result = subject.features
111
111
 
112
112
  event = instrumenter.events.last
113
- event.should_not be_nil
114
- event.name.should eq('adapter_operation.flipper')
115
- event.payload[:operation].should eq(:features)
116
- event.payload[:adapter_name].should eq(:memory)
117
- event.payload[:result].should be(result)
113
+ expect(event).not_to be_nil
114
+ expect(event.name).to eq('adapter_operation.flipper')
115
+ expect(event.payload[:operation]).to eq(:features)
116
+ expect(event.payload[:adapter_name]).to eq(:memory)
117
+ expect(event.payload[:result]).to be(result)
118
118
  end
119
119
  end
120
120
  end