Sha256: fa7516458db77ed75635d717f0c98d5ce71c473460dd379b2127dc6cdfb2de94

Contents?: true

Size: 984 Bytes

Versions: 2

Compression:

Stored size: 984 Bytes

Contents

require "spec_helper"

describe Rico do
  before :each do
    RiakHelpers.reset!
  end

  describe ".configure" do
    it "accepts a namespace" do
      Rico.configure do |r|
        r.namespace = "myapp"
      end

      Rico.namespace.should eql "myapp"
    end

    it "accepts a riak client instance" do
      riak = Riak::Client.new
      Rico.configure do |r|
        r.riak = riak
      end

      Rico.riak.should eql riak
    end
  end

  describe ".bucket" do
    describe "namespacing" do
      it "supports an empty namespace" do
        Rico.namespace = nil
        Rico.bucket("users").name.should eql "users"
      end

      it "supports a single namespace" do
        Rico.namespace = "development"
        Rico.bucket("users").name.should eql "development:users"
      end

      it "supports multiple namespaces" do
        Rico.namespace = ["myapp", "development"]
        Rico.bucket("users").name.should eql "myapp:development:users"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rico-0.1.0 spec/rico_spec.rb
rico-0.0.1 spec/rico_spec.rb