Skip to content

Commit b02107e

Browse files
committed
Fix unit test issue
1 parent accb52f commit b02107e

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

spec/config/datafile_project_config_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,9 +1974,9 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
19741974
end
19751975
end
19761976

1977-
describe '#get_global_holdouts' do
1977+
describe '#global_holdouts' do
19781978
it 'returns only holdouts without includedRules (global holdouts)' do
1979-
global_holdouts = config_with_local_holdouts.get_global_holdouts
1979+
global_holdouts = config_with_local_holdouts.global_holdouts
19801980

19811981
expect(global_holdouts).not_to be_nil
19821982
expect(global_holdouts).to be_an(Array)
@@ -1988,14 +1988,14 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
19881988
end
19891989

19901990
it 'does not include local holdouts (those with includedRules array)' do
1991-
global_holdouts = config_with_local_holdouts.get_global_holdouts
1991+
global_holdouts = config_with_local_holdouts.global_holdouts
19921992
local_holdout = config_with_local_holdouts.get_holdout('holdout_local_1')
19931993

19941994
expect(global_holdouts).not_to include(local_holdout)
19951995
end
19961996

19971997
it 'does not include holdouts with empty includedRules array' do
1998-
global_holdouts = config_with_local_holdouts.get_global_holdouts
1998+
global_holdouts = config_with_local_holdouts.global_holdouts
19991999
empty_local_holdout = config_with_local_holdouts.get_holdout('holdout_local_empty_rules')
20002000

20012001
# Empty [] is local, not global — must not appear in global_holdouts
@@ -2022,7 +2022,7 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
20222022
logger,
20232023
error_handler
20242024
)
2025-
expect(config_no_global.get_global_holdouts).to eq([])
2025+
expect(config_no_global.global_holdouts).to eq([])
20262026
end
20272027
end
20282028

@@ -2079,7 +2079,7 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
20792079

20802080
# Must be classified as global
20812081
expect(config_global_only.holdout_global?(holdout)).to be true
2082-
expect(config_global_only.get_global_holdouts).to include(holdout)
2082+
expect(config_global_only.global_holdouts).to include(holdout)
20832083
expect(config_global_only.get_holdouts_for_rule('any_rule')).to eq([])
20842084
end
20852085

spec/decision_service_holdout_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@
783783
expect(config_with_local_holdouts.holdout_global?(global_holdout)).to be true
784784

785785
# Verify it appears in global_holdouts list
786-
expect(config_with_local_holdouts.get_global_holdouts).to include(global_holdout)
786+
expect(config_with_local_holdouts.global_holdouts).to include(global_holdout)
787787

788788
# Mock the holdout to return a decision to simulate user being in global holdout
789789
allow(decision_service_local).to receive(:get_variation_for_holdout)
@@ -836,10 +836,10 @@
836836
expect(rule_holdouts).to include(local_holdout)
837837

838838
# Verify it is NOT in global holdouts
839-
expect(config_with_local_holdouts.get_global_holdouts).not_to include(local_holdout)
839+
expect(config_with_local_holdouts.global_holdouts).not_to include(local_holdout)
840840

841841
# Set up global holdouts to miss (no global holdout decision)
842-
config_with_local_holdouts.get_global_holdouts.each do |gh|
842+
config_with_local_holdouts.global_holdouts.each do |gh|
843843
allow(decision_service_local).to receive(:get_variation_for_holdout)
844844
.with(gh, anything, anything)
845845
.and_return(Optimizely::DecisionService::DecisionResult.new(nil, false, []))
@@ -889,7 +889,7 @@
889889
expect(local_holdout).not_to be_nil
890890

891891
# All global holdouts miss
892-
config_with_local_holdouts.get_global_holdouts.each do |gh|
892+
config_with_local_holdouts.global_holdouts.each do |gh|
893893
allow(decision_service_local).to receive(:get_variation_for_holdout)
894894
.with(gh, anything, anything)
895895
.and_return(Optimizely::DecisionService::DecisionResult.new(nil, false, []))

0 commit comments

Comments
 (0)