yggdrasil-engine 0.0.5.beta.14-x86_64-darwin → 0.0.5.beta.16-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75513bb9327c0af736e5e47a95dc81eebc90f6695d138059b6f2f846ebd259af
4
- data.tar.gz: 73cb51f7bd299ed33593f69e9490abdad55a088104be2d5e107fce15e68348e8
3
+ metadata.gz: f4195bc7283f3732b7c5ce81c97cddb29589dbbdd698fc09b447b1af5f06da89
4
+ data.tar.gz: 74395c5180ac568d4cefea289723c0960069a102658e7408eefa88666c6e1fa1
5
5
  SHA512:
6
- metadata.gz: d383371857cf9bb10b4e5341b0998646c83c572a14bbffe7a4ac5e1596c7e56985e4c4f82d3637a9590a934455bbf3a32a75fd5341de9d2ac425f3371617c2f2
7
- data.tar.gz: cdff4ee4abf152bfe93ad3ba619a9ea12ac6136208a7c1395f4735660d39a0cdb2d578840fb3d5b6469f0521ce8f478cd976384319b8ef7d73ce0a62c5db0588
6
+ metadata.gz: 0344b17b8e4b7edb23f1de1476ef0e9cb263c8789f2b35693520ac635fdba00073f48646b7433016f3cab79bef8696ad44ac858f1e02ba9f8c90819524f4f060
7
+ data.tar.gz: 0b12223501f60cea29094b75c99c1d46400a92705939a14ec8f951b00e7525d03199ace5aed3760ad59a488aa0b1bf295cb834929bf395f1ca60694da3362113
Binary file
@@ -5,6 +5,16 @@ require_relative '../lib/yggdrasil_engine'
5
5
  index_file_path = '../client-specification/specifications/index.json'
6
6
  test_suites = JSON.parse(File.read(index_file_path))
7
7
 
8
+ def test_suite_variant(base_variant)
9
+ payload = base_variant[:payload] && base_variant[:payload].transform_keys(&:to_s)
10
+ {
11
+ name: base_variant[:name],
12
+ enabled: base_variant[:enabled],
13
+ feature_enabled: base_variant[:feature_enabled],
14
+ payload: payload,
15
+ }
16
+ end
17
+
8
18
  RSpec.describe YggdrasilEngine do
9
19
  let(:yggdrasil_engine) { YggdrasilEngine.new }
10
20
 
@@ -119,13 +129,14 @@ RSpec.describe 'Client Specification' do
119
129
  describe "Variant Test '#{test[:description]}'" do
120
130
  let(:context) { test[:context] }
121
131
  let(:toggle_name) { test[:toggleName] }
122
- let(:expected_result) { to_variant(test[:expectedResult]) }
132
+ let(:expected_result) { test_suite_variant(test[:expectedResult]) }
123
133
 
124
134
  it 'returns correct result for `get_variant` method' do
125
135
  result = yggdrasil_engine.get_variant(toggle_name, context) || {
126
136
  :name => 'disabled',
127
137
  :payload => nil,
128
- :enabled => false
138
+ :enabled => false,
139
+ :feature_enabled => false
129
140
  }
130
141
 
131
142
  expect(result[:name]).to eq(expected_result[:name])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yggdrasil-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.beta.14
4
+ version: 0.0.5.beta.16
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Unleash