Sha256: 56e97600e6d2c26ca5dac482497a43a2858c3d6e1194b321ae451d96ce313a41

Contents?: true

Size: 573 Bytes

Versions: 9

Compression:

Stored size: 573 Bytes

Contents

require "spec_helper"

describe Trifle::InitializeWithRedis do

  describe "#initialize" do
    before do
      @klass = Class.new do
        include Trifle::InitializeWithRedis
      end
    end

    it "should accept a redis instance" do
      @klass.new(Redis.new).should be_a(@klass)
    end

    it "should fail without a redis instance" do
      -> { @klass.new(nil) }.should raise_error(ArgumentError)
    end

    it "should accept an optional redis key" do
      instance = @klass.new(Redis.new, key: "foo")
      instance.key.should be == "foo"
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trifle-0.1.0 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.9 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.8 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.7 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.6 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.5 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.4 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.3 spec/trifle/initialize_with_redis_spec.rb
trifle-0.0.2 spec/trifle/initialize_with_redis_spec.rb