test/test_config_resolver.rb in prefab-cloud-ruby-0.10.0 vs test/test_config_resolver.rb in prefab-cloud-ruby-0.11.0
- old
+ new
@@ -115,16 +115,16 @@
Prefab::FeatureFlagVariant.new(string: "env"),
],
rows: [
{ value: Prefab::ConfigValue.new(feature_flag: Prefab::FeatureFlag.new(
inactive_variant_idx: 0,
- default: Prefab::VariantDistribution.new(variant_idx: 1)
+ rules: default_ff_rule(1),
)) },
{ project_env_id: TEST_ENV_ID,
value: Prefab::ConfigValue.new(feature_flag: Prefab::FeatureFlag.new(
inactive_variant_idx: 0,
- default: Prefab::VariantDistribution.new(variant_idx: 2)
+ rules: default_ff_rule(2),
)) }
]
)
}
@loader.stub :calc_config, loaded_values do
@@ -187,9 +187,12 @@
assert_equal "value", @resolverWithProperlySegmentedNamespace.get("Key:With:Colons")
end
end
def resolver_for_namespace(namespace, loader, project_env_id: TEST_ENV_ID)
- Prefab::ConfigResolver.new(MockBaseClient.new(namespace: namespace, project_env_id: project_env_id), loader)
+ resolver = Prefab::ConfigResolver.new(MockBaseClient.new(namespace: namespace), loader)
+ resolver.project_env_id = project_env_id
+ resolver.update
+ resolver
end
end