File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ Split.configure do |config|
387387 config.on_before_experiment_reset = -> (example) { # Do something on reset }
388388 config.on_before_experiment_delete = -> (experiment) { # Do something else on delete }
389389 # after experiment winner had been set
390- config.on_winner_choose = -> (experiment) { # Do something on winner choose }
390+ config.on_experiment_winner_choose = -> (experiment) { # Do something on winner choose }
391391end
392392```
393393
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Configuration
2020 attr_accessor :on_experiment_reset
2121 attr_accessor :on_experiment_delete
2222 attr_accessor :on_before_experiment_reset
23- attr_accessor :on_winner_choose
23+ attr_accessor :on_experiment_winner_choose
2424 attr_accessor :on_before_experiment_delete
2525 attr_accessor :include_rails_helper
2626 attr_accessor :beta_probability_simulations
@@ -217,7 +217,7 @@ def initialize
217217 @on_experiment_delete = proc { |experiment |}
218218 @on_before_experiment_reset = proc { |experiment |}
219219 @on_before_experiment_delete = proc { |experiment |}
220- @on_winner_choose = proc { |experiment |}
220+ @on_experiment_winner_choose = proc { |experiment |}
221221 @db_failover_allow_parameter_override = false
222222 @allow_multiple_experiments = false
223223 @enabled = true
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ def has_winner?
155155 def winner = ( winner_name )
156156 redis . hset ( :experiment_winner , name , winner_name . to_s )
157157 @has_winner = true
158- Split . configuration . on_winner_choose . call ( self )
158+ Split . configuration . on_experiment_winner_choose . call ( self )
159159 end
160160
161161 def participant_count
Original file line number Diff line number Diff line change @@ -239,8 +239,8 @@ def alternative(color)
239239 expect ( experiment . winner . name ) . to eq ( 'red' )
240240 end
241241
242- it 'should call the on_winner_choose hook' do
243- expect ( Split . configuration . on_winner_choose ) . to receive ( :call )
242+ it 'should call the on_experiment_winner_choose hook' do
243+ expect ( Split . configuration . on_experiment_winner_choose ) . to receive ( :call )
244244 experiment . winner = 'green'
245245 end
246246
You can’t perform that action at this time.
0 commit comments