yggdrasil-engine 0.0.5.beta.13-universal-java-1.8 → 0.0.5.beta.15-universal-java-1.8

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: a64d1a0f6b82e82363a3689952773ab8f07d6db02a5e2733bfa2745cb3f5a198
4
- data.tar.gz: e490ba5eccf458b3aad307adfd3fe4517eb86502e95b54a3c08ff4706f9adef2
3
+ metadata.gz: dc24e88828f5e81586fe34b0a31054893aded63ac31950ad2c8df76c2893ee48
4
+ data.tar.gz: 72fb4fe76e22e52a2b09d0c3cab0f7e059c5b670058196e76c7809d7b776871c
5
5
  SHA512:
6
- metadata.gz: 8700ac8da9e87c1b04a3383969f72017c665711134eaaf1a471c39788353af364c534279a5b1ad3b1294c1053f10d2dd8c73e33ed08a61280df26f7ecdd4bd48
7
- data.tar.gz: 4ec339e0bb8a6f4d8015d6f0bb306610bf8f7a90d4fe7927e1defe941f0228f67df6376365db66411a2405d7e9503e54105a5e3a5d36e7a7934c7a56d633176c
6
+ metadata.gz: 97627019deeca6356ddd25d2012ac583ea229fe1cd4bb43a16f4b4cc465726df2cc995caee9602b60dc811051f1cbe2a81f5770b6cf81400a039611ccad16d32
7
+ data.tar.gz: 74dc421ca8bc694b73d6f5ed42c19e8b4805210d22b6987465fedb4dc834b35f6683b0cd354740f90cd75db58883341dd229626f09c2bf23b0aa1a6c09d0f7fe
Binary file
Binary file
Binary file
Binary file
@@ -38,6 +38,7 @@ def to_variant(raw_variant)
38
38
  {
39
39
  name: raw_variant[:name],
40
40
  enabled: raw_variant[:enabled],
41
+ feature_enabled: raw_variant[:featureEnabled],
41
42
  payload: payload,
42
43
  }
43
44
  end
@@ -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,18 +129,20 @@ 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])
132
143
  expect(result[:payload]).to eq(expected_result[:payload])
133
144
  expect(result[:enabled]).to eq(expected_result[:enabled])
145
+ expect(result[:feature_enabled]).to eq(expected_result[:feature_enabled])
134
146
  end
135
147
  end
136
148
  end
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.13
4
+ version: 0.0.5.beta.15
5
5
  platform: universal-java-1.8
6
6
  authors:
7
7
  - Unleash