FIX: Make test less fragile.

This commit is contained in:
Guo Xiang Tan 2019-01-02 16:32:14 +08:00
parent 766e67ce57
commit 38ded77e16
1 changed files with 6 additions and 3 deletions

View File

@ -175,9 +175,12 @@ describe DiscourseRedis do
end
it "should raise the right error" do
error = RuntimeError.new('test error')
Redis::Client.any_instance.expects(:call).raises(error).twice
2.times { expect { connector.resolve }.to raise_error(error) }
error = RuntimeError.new('test')
2.times do
expect { connector.resolve(BrokenRedis.new(error)) }
.to raise_error(error)
end
end
end