Sha256: 1a36ff5869014a71219f13fd7dd8abefbc4902471f2ca78a0c8d206225db6784

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe BitzerStore::Configure do
  context "#set" do
    it "add settings" do
      c = BitzerStore::Configure.new
      c.set(:cache_name, :dalli, "localhost:11211", :expires_in => 600)
      expect(c.settings.keys.first).to eq(:cache_name)
      expect(c.settings.values.first).to eq([:dalli, "localhost:11211", :expires_in => 600])
    end

    it "use method_missing" do
      c = BitzerStore::Configure.new
      c.cache_name :dalli, "localhost:11211", :expires_in => 600
      expect(c.settings.keys.first).to eq(:cache_name)
      expect(c.settings.values.first).to eq([:dalli, "localhost:11211", :expires_in => 600])
    end

    it "use common_setting" do
      c = BitzerStore::Configure.new
      c.common_setting :dalli, "localhost:11211", :expires_in => 600, :namespace => "tsuka"
      c.cache_name :namespace => "special"
      expect(c.settings.keys.first).to eq(:cache_name)
      expect(c.settings.values.first).to eq([:dalli, "localhost:11211", :expires_in => 600, :namespace => "special"])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitzer_store-0.0.2 spec/unit/bitzer_store_configure_spec.rb