Skip to content

Commit

Permalink
Specs for the circuit breaker module (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolshakov authored Feb 5, 2023
1 parent 80ec8fa commit 4af5308
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions spec/stoplight/circuit_breaker_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Stoplight::CircuitBreaker do
subject(:circuit_breaker) { klass.new }

let(:klass) do
Class.new { include Stoplight::CircuitBreaker }
end

specify '#with_error_handler' do
expect { circuit_breaker.with_error_handler {} }.to raise_error(NotImplementedError)
end

specify '#with_fallback' do
expect { circuit_breaker.with_fallback {} }.to raise_error(NotImplementedError)
end

specify '#color' do
expect { circuit_breaker.color }.to raise_error(NotImplementedError)
end

specify '#run' do
expect { circuit_breaker.run {} }.to raise_error(NotImplementedError)
end

specify '#lock' do
expect { circuit_breaker.lock('red') }.to raise_error(NotImplementedError)
end

specify '#unlock' do
expect { circuit_breaker.unlock }.to raise_error(NotImplementedError)
end
end

0 comments on commit 4af5308

Please sign in to comment.