test/test_helper.rb in prefab-cloud-ruby-0.10.0 vs test/test_helper.rb in prefab-cloud-ruby-0.11.0
- old
+ new
@@ -3,25 +3,25 @@
class MockBaseClient
STAGING_ENV_ID = 1
PRODUCTION_ENV_ID = 2
TEST_ENV_ID = 3
- attr_reader :namespace, :logger, :project_env_id, :config_client
+ attr_reader :namespace, :logger, :config_client
- def initialize(project_env_id: TEST_ENV_ID, namespace: "")
- @project_env_id = project_env_id
+ def initialize(namespace: "")
+
@namespace = namespace
@logger = Logger.new($stdout)
@config_client = MockConfigClient.new
end
def project_id
1
end
- def project_env_id
- @project_env_id
+ def log
+ @logger
end
def log_internal level, message
end
@@ -49,6 +49,21 @@
end
class MockConfigLoader
def calc_config
end
+end
+
+
+private
+
+def default_ff_rule(variant_idx)
+ [
+ Prefab::Rule.new(
+ criteria: Prefab::Criteria.new(operator: Prefab::Criteria::CriteriaOperator::ALWAYS_TRUE),
+ variant_weights: [
+ Prefab::VariantWeight.new(weight: 1000,
+ variant_idx: variant_idx)
+ ]
+ )
+ ]
end