Sha256: c4e026127f52d8846d7ee1f125af664b219639fb75a473965ac1b66285542386

Contents?: true

Size: 718 Bytes

Versions: 6

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

require "spec_helpers"

describe Wayfarer::Config::Redis do
  let(:env) { {} }
  subject(:redis) { Wayfarer::Config::Redis.new(env) }

  describe "#url" do
    context "by default" do
      it "is redis://localhost:6379" do
        expect(redis.url).to eq("redis://localhost:6379")
      end
    end

    context "with env var set" do
      before { env["WAYFARER_REDIS_URL"] = "redis://redis:6379" }

      it "parses the env var" do
        expect(redis.url).to eq("redis://redis:6379")
      end
    end
  end

  describe "#factory" do
    context "by default" do
      it "instantiates Redis" do
        expect(redis.factory.call(redis)).to be_a(::Redis)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wayfarer-0.4.6 spec/config/redis_spec.rb
wayfarer-0.4.5 spec/config/redis_spec.rb
wayfarer-0.4.4 spec/config/redis_spec.rb
wayfarer-0.4.3 spec/config/redis_spec.rb
wayfarer-0.4.2 spec/config/redis_spec.rb
wayfarer-0.4.1 spec/config/redis_spec.rb