Skip to content

Commit cf4255e

Browse files
Mat001claude
andcommitted
Fix Rubocop offenses in local holdouts spec files
- Fix Layout/SpaceInsideHashLiteralBraces in datafile_project_config_spec.rb - Fix Lint/UselessAssignment by removing unused feature_flag variable in decision_service_holdout_spec.rb Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0f22766 commit cf4255e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎spec/config/datafile_project_config_spec.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
19551955
end
19561956

19571957
it 'returns true for holdout with explicit nil includedRules' do
1958-
holdout = { 'id' => 'test', 'key' => 'test', 'includedRules' => nil }
1958+
holdout = {'id' => 'test', 'key' => 'test', 'includedRules' => nil}
19591959
expect(config_with_local_holdouts.holdout_global?(holdout)).to be true
19601960
end
19611961

@@ -2013,8 +2013,8 @@ def build_datafile(experiments: [], rollouts: [], feature_flags: [])
20132013
'status' => 'Running',
20142014
'audiences' => [],
20152015
'includedRules' => ['some_rule_id'],
2016-
'variations' => [{ 'id' => 'v1', 'key' => 'holdout', 'featureEnabled' => false }],
2017-
'trafficAllocation' => [{ 'entityId' => 'v1', 'endOfRange' => 10_000 }]
2016+
'variations' => [{'id' => 'v1', 'key' => 'holdout', 'featureEnabled' => false}],
2017+
'trafficAllocation' => [{'entityId' => 'v1', 'endOfRange' => 10_000}]
20182018
}
20192019
]
20202020
)

‎spec/decision_service_holdout_spec.rb‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@
864864
# Spy on get_variation to verify it is NOT called (audience/traffic skipped)
865865
allow(decision_service_local).to receive(:get_variation).and_call_original
866866

867-
feature_flag = config_with_local_holdouts.feature_flag_key_map['boolean_feature']
868867
user_ctx = project_with_local_holdouts.create_user_context('test_user', {})
869868
user_profile_tracker = Optimizely::UserProfileTracker.new('test_user', nil, spy_logger)
870869

@@ -904,7 +903,6 @@
904903
# Track that get_variation (regular rule evaluation) is called
905904
allow(decision_service_local).to receive(:get_variation).and_call_original
906905

907-
feature_flag = config_with_local_holdouts.feature_flag_key_map['boolean_feature']
908906
user_ctx = project_with_local_holdouts.create_user_context('test_user', {})
909907
user_profile_tracker = Optimizely::UserProfileTracker.new('test_user', nil, spy_logger)
910908

0 commit comments

Comments
 (0)