Skip to content

Commit 3c0e2e3

Browse files
committed
cleanup
1 parent b5b549d commit 3c0e2e3

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

lib/splitclient-rb/managers/split_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def build_split_view(name, split)
106106
treatments: treatments,
107107
change_number: split[:changeNumber],
108108
configs: split[:configurations] || {},
109-
sets: split[:sets] || []
109+
sets: split[:sets] || [],
110110
default_treatment: split[:defaultTreatment]
111111
}
112112
end

spec/splitclient/manager_localhost_spec.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
killed: false,
2121
name: 'local_feature',
2222
traffic_type_name: nil,
23-
treatments: ['local_treatment'] }
23+
treatments: ['local_treatment'],
24+
sets: [] }
2425
end
2526

2627
let(:split_views) do
@@ -30,14 +31,16 @@
3031
killed: false,
3132
name: 'local_feature',
3233
traffic_type_name: nil,
33-
treatments: ['local_treatment'] },
34+
treatments: ['local_treatment'],
35+
sets: [] },
3436
{ change_number: nil,
3537
configs: { local_treatment2: nil },
3638
default_treatment: "control_treatment",
3739
killed: false,
3840
name: 'local_feature2',
3941
traffic_type_name: nil,
40-
treatments: ['local_treatment2'] }]
42+
treatments: ['local_treatment2'],
43+
sets: [] }]
4144
end
4245

4346
it 'validates the calling manager.splits returns the offline data' do
@@ -66,7 +69,8 @@
6669
killed: false,
6770
name: 'multiple_keys_feature',
6871
traffic_type_name: nil,
69-
treatments: %w[off on] },
72+
treatments: %w[off on],
73+
sets: [] },
7074
{ change_number: nil,
7175
configs: {
7276
on: '{"desc":"this applies only to ON and only for john_doe. The rest will receive OFF"}',
@@ -76,7 +80,8 @@
7680
killed: false,
7781
name: 'single_key_feature',
7882
traffic_type_name: nil,
79-
treatments: %w[on off] },
83+
treatments: %w[on off],
84+
sets: [] },
8085
{ change_number: nil,
8186
configs: {
8287
off: '{"desc":"this applies only to OFF treatment"}'
@@ -85,7 +90,8 @@
8590
killed: false,
8691
name: 'no_keys_feature',
8792
traffic_type_name: nil,
88-
treatments: %w[off] }]
93+
treatments: %w[off],
94+
sets: [] }]
8995
end
9096

9197
it 'returns split_names' do

0 commit comments

Comments
 (0)