Sha256: c1acf7a4000c0f44631ac02a9c75980f4ea6d159cbeee33a3faa6c326a2268fc
Contents?: true
Size: 629 Bytes
Versions: 20
Compression:
Stored size: 629 Bytes
Contents
require 'spec_helper' class TestRetriable include Vx::ContainerConnector::Retriable class Error < Exception ; end end describe Vx::ContainerConnector::Retriable do let(:proxy) { TestRetriable.new } it "should rescue 2 times" do expect(test_retriable(2)).to eq :pass end it "should fail on 3 attempt" do expect { test_retriable(3) }.to raise_error(TestRetriable::Error, "0") end def test_retriable(n) proxy.with_retries(TestRetriable::Error, limit: 3, sleep: 0.1) do if n != 0 n -= 1 raise TestRetriable::Error.new(n.to_s) end :pass end end end
Version data entries
20 entries across 20 versions & 1 rubygems