mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Reorganize some specs
This commit is contained in:
parent
36354082c7
commit
9d4a5886e5
5 changed files with 3 additions and 3 deletions
41
spec/features/aggregate_failures_spec.cr
Normal file
41
spec/features/aggregate_failures_spec.cr
Normal file
|
@ -0,0 +1,41 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe Spectator do
|
||||
describe "aggregate_failures" do
|
||||
it "captures multiple failed expectations" do
|
||||
expect do
|
||||
aggregate_failures do
|
||||
expect(true).to be_false
|
||||
expect(false).to be_true
|
||||
end
|
||||
end.to raise_error(Spectator::MultipleExpectationsFailed, /2 failures/)
|
||||
end
|
||||
|
||||
it "raises normally for one failed expectation" do
|
||||
expect do
|
||||
aggregate_failures do
|
||||
expect(true).to be_false
|
||||
expect(true).to be_true
|
||||
end
|
||||
end.to raise_error(Spectator::ExpectationFailed)
|
||||
end
|
||||
|
||||
it "doesn't raise when there are no failed expectations" do
|
||||
expect do
|
||||
aggregate_failures do
|
||||
expect(false).to be_false
|
||||
expect(true).to be_true
|
||||
end
|
||||
end.to_not raise_error(Spectator::ExpectationFailed)
|
||||
end
|
||||
|
||||
it "supports naming the block" do
|
||||
expect do
|
||||
aggregate_failures "contradiction" do
|
||||
expect(true).to be_false
|
||||
expect(false).to be_true
|
||||
end
|
||||
end.to raise_error(Spectator::MultipleExpectationsFailed, /contradiction/)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue