test/test_helper.rb in prefab-cloud-ruby-0.22.0 vs test/test_helper.rb in prefab-cloud-ruby-0.23.0
- old
+ new
@@ -41,11 +41,11 @@
class MockConfigClient
def initialize(config_values = {})
@config_values = config_values
end
- def get(key, default = nil)
+ def get(key, default = nil, _, _)
@config_values.fetch(key, default)
end
def get_config(key)
Prefab::Config.new(value: @config_values[key], key: key)
@@ -90,6 +90,22 @@
prefab_envs: ['unit_tests'],
prefab_datasources: Prefab::Options::DATASOURCES::LOCAL_ONLY
}.merge(overrides))
Prefab::Client.new(options)
+end
+
+def string_list(values)
+ Prefab::ConfigValue.new(string_list: Prefab::StringList.new(values: values))
+end
+
+def inject_config(client, config)
+ resolver = client.config_client.instance_variable_get('@config_resolver')
+ store = resolver.instance_variable_get('@local_store')
+
+ store[config.key] = { config: config }
+end
+
+def inject_project_env_id(client, project_env_id)
+ resolver = client.config_client.instance_variable_get('@config_resolver')
+ resolver.project_env_id = project_env_id
end