Skip to content

Commit e0fc413

Browse files
get code coverage to 100%!
1 parent cb9080a commit e0fc413

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spec/database_cleaner/redis/truncation_spec.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,20 @@
6464
end
6565

6666
context "when passing url" do
67-
it "should store my describe db" do
68-
url = 'redis://localhost:6379/2'
69-
subject.db = 'redis://localhost:6379/2'
67+
it "still works" do
68+
url = @redis.connection[:id]
69+
subject.db = url
7070
expect(subject.db).to eq url
71+
expect { subject.clean }.to change { @redis.keys.size }.from(2).to(0)
7172
end
7273
end
7374

7475
context "when passing connection" do
75-
it "should store my describe db" do
76-
connection = ::Redis.new :url => 'redis://localhost:6379/2'
76+
it "still works" do
77+
connection = Redis.new(url: @redis.connection[:id])
7778
subject.db = connection
7879
expect(subject.db).to eq connection
80+
expect { subject.clean }.to change { @redis.keys.size }.from(2).to(0)
7981
end
8082
end
8183

0 commit comments

Comments
 (0)