Sha256: 439dbcc51ec61ec97c61e650831b9f1fe900149ee8032333439a33ac7ef06eda

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

require "feature_store_spec_base"
require "diplomat"
require "spec_helper"


$my_prefix = 'testprefix'
$null_log = ::Logger.new($stdout)
$null_log.level = ::Logger::FATAL

$consul_base_opts = {
  prefix: $my_prefix,
  logger: $null_log
}

def create_consul_store(opts = {})
  LaunchDarkly::Integrations::Consul::new_feature_store(
    $consul_base_opts.merge(opts).merge({ expiration: 60 }))
end

def create_consul_store_uncached(opts = {})
  LaunchDarkly::Integrations::Consul::new_feature_store(
    $consul_base_opts.merge(opts).merge({ expiration: 0 }))
end

def clear_all_data
  Diplomat::Kv.delete($my_prefix + '/', recurse: true)
end


describe "Consul feature store" do
  
  # These tests will all fail if there isn't a local Consul instance running.
  
  context "with local cache" do
    include_examples "feature_store", method(:create_consul_store), method(:clear_all_data)
  end

  context "without local cache" do
    include_examples "feature_store", method(:create_consul_store_uncached), method(:clear_all_data)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ldclient-rb-5.5.5 spec/integrations/consul_feature_store_spec.rb
ldclient-rb-5.5.4 spec/integrations/consul_feature_store_spec.rb
ldclient-rb-5.5.3 spec/integrations/consul_feature_store_spec.rb
ldclient-rb-5.5.2 spec/integrations/consul_feature_store_spec.rb
ldclient-rb-5.5.1 spec/integrations/consul_feature_store_spec.rb
ldclient-rb-5.5.0 spec/integrations/consul_feature_store_spec.rb