Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions spec/lib/coach/middleware_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
require "coach/middleware_validator"

describe Coach::MiddlewareValidator do
subject(:validator) { described_class.new(head_middleware, already_provided) }

let(:head_middleware) { build_middleware("Head") }
let(:already_provided) { [] }

Expand All @@ -22,7 +20,7 @@
end

describe "#validated_provides!" do
subject { -> { validator.validated_provides! } }
subject(:validator) { -> { described_class.new(head_middleware, already_provided).validated_provides! } }

context "with satisfied requires" do
context "one level deep" do
Expand Down Expand Up @@ -60,7 +58,9 @@
context "at terminal" do
before { head_middleware.requires :a, :c }

it { is_expected.to raise_exception(/missing \[:a, :c\]/) }
it "raises an exception" do
expect { validator.call }.to raise_exception(/missing \[:a, :c\]/)
end
end

context "from unordered middleware" do
Expand All @@ -69,7 +69,9 @@
middleware_b.provides :b
end

it { is_expected.to raise_exception(/missing \[:b\]/) }
it "raises an exception" do
expect { validator.call }.to raise_exception(/missing \[:b\]/)
end
end
end
end
Expand Down