Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chillaq committed Dec 7, 2023
1 parent b5b549d commit 3c0e2e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/splitclient-rb/managers/split_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def build_split_view(name, split)
treatments: treatments,
change_number: split[:changeNumber],
configs: split[:configurations] || {},
sets: split[:sets] || []
sets: split[:sets] || [],
default_treatment: split[:defaultTreatment]
}
end
Expand Down
18 changes: 12 additions & 6 deletions spec/splitclient/manager_localhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
killed: false,
name: 'local_feature',
traffic_type_name: nil,
treatments: ['local_treatment'] }
treatments: ['local_treatment'],
sets: [] }
end

let(:split_views) do
Expand All @@ -30,14 +31,16 @@
killed: false,
name: 'local_feature',
traffic_type_name: nil,
treatments: ['local_treatment'] },
treatments: ['local_treatment'],
sets: [] },
{ change_number: nil,
configs: { local_treatment2: nil },
default_treatment: "control_treatment",
killed: false,
name: 'local_feature2',
traffic_type_name: nil,
treatments: ['local_treatment2'] }]
treatments: ['local_treatment2'],
sets: [] }]
end

it 'validates the calling manager.splits returns the offline data' do
Expand Down Expand Up @@ -66,7 +69,8 @@
killed: false,
name: 'multiple_keys_feature',
traffic_type_name: nil,
treatments: %w[off on] },
treatments: %w[off on],
sets: [] },
{ change_number: nil,
configs: {
on: '{"desc":"this applies only to ON and only for john_doe. The rest will receive OFF"}',
Expand All @@ -76,7 +80,8 @@
killed: false,
name: 'single_key_feature',
traffic_type_name: nil,
treatments: %w[on off] },
treatments: %w[on off],
sets: [] },
{ change_number: nil,
configs: {
off: '{"desc":"this applies only to OFF treatment"}'
Expand All @@ -85,7 +90,8 @@
killed: false,
name: 'no_keys_feature',
traffic_type_name: nil,
treatments: %w[off] }]
treatments: %w[off],
sets: [] }]
end

it 'returns split_names' do
Expand Down

0 comments on commit 3c0e2e3

Please sign in to comment.