Skip to content

Commit

Permalink
Add specs for the Stoplight::Notifier::Generic#put method
Browse files Browse the repository at this point in the history
  • Loading branch information
bolshakov committed Dec 11, 2022
1 parent 845fdfd commit dac554c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/stoplight/notifier/generic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,24 @@
it 'is a module' do
expect(described_class).to be_a(Module)
end

describe '#notify' do
let(:light) { Stoplight::Light.new(name) {} }
let(:name) { ('a'..'z').to_a.shuffle.join }
let(:from_color) { Stoplight::Color::GREEN }
let(:to_color) { Stoplight::Color::RED }
let(:notifier) { notifier_class.new(double.as_null_object) }
let(:error) { nil }
let(:notifier_class) do
Class.new do
include Stoplight::Notifier::Generic
end
end

it 'has to implement the #put method' do
expect do
notifier.notify(light, from_color, to_color, error)
end.to raise_error(NotImplementedError)
end
end
end

0 comments on commit dac554c

Please sign in to comment.