Skip to content

Commit

Permalink
Get specs running again
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsyweb committed Apr 29, 2022
1 parent 86474fc commit cd9c855
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spec/fresh_redis_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
require 'fresh_redis'
require 'mock_redis'
# frozen_string_literal: true

require "fresh_redis"
require "mock_redis"

describe FreshRedis do
let(:mock_redis) { MockRedis.new }

describe "#build_key" do
it "builds a new key based on custom options" do
key = "key"
FreshRedis::Key.should_receive(:build).with("foo", :granularity => 111, :freshness => 222).and_return(key)
expect(FreshRedis::Key).to receive(:build).with("foo",
hash_including(granularity: 111, freshness: 222))
.and_return(key)

fresh_redis = FreshRedis.new(mock_redis, :granularity => 111, :freshness => 222)
fresh_redis = FreshRedis.new(mock_redis, granularity: 111, freshness: 222)

fresh_redis.build_key("foo").should == key
expect(fresh_redis.build_key("foo")).to eq key
end

it "builds a new key no options if custom options not provided" do
Expand All @@ -20,8 +24,7 @@

fresh_redis = FreshRedis.new(mock_redis)

fresh_redis.build_key("foo").should == key
expect(fresh_redis.build_key("foo")).to eq key
end

end
end

0 comments on commit cd9c855

Please sign in to comment.