Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Relax aggregate failures expectations on messages #2759

Merged
merged 1 commit into from
Sep 3, 2020
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
16 changes: 8 additions & 8 deletions spec/rspec/core/aggregate_failures_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

expect(ex.execution_result.__send__(exception_attribute)).to have_attributes(
:all_exceptions => [
an_object_having_attributes(:message => 'expected `1.even?` to return true, got false'),
an_object_having_attributes(:message => /expected.*even\?/),
an_object_having_attributes(:message => 'after'),
an_object_having_attributes(:message => 'around')
]
Expand Down Expand Up @@ -49,8 +49,8 @@
)

expect(exception.all_exceptions.first.all_exceptions).to match [
an_object_having_attributes(:message => 'expected `1.even?` to return true, got false'),
an_object_having_attributes(:message => 'expected `2.odd?` to return true, got false')
an_object_having_attributes(:message => /expected.*even\?/),
an_object_having_attributes(:message => /expected.*odd\?/)
]
end
end
Expand All @@ -71,8 +71,8 @@
expect(ex.execution_result.status).to eq(:pending) if example_meta.key?(:pending)
expect(ex.execution_result.__send__(exception_attribute)).to have_attributes(
:all_exceptions => [
an_object_having_attributes(:message => 'expected `1.even?` to return true, got false'),
an_object_having_attributes(:message => 'expected `2.odd?` to return true, got false')
an_object_having_attributes(:message => /expected.*even\?/),
an_object_having_attributes(:message => /expected.*odd\?/)
]
)
end
Expand All @@ -90,7 +90,7 @@

expect(ex.execution_result.__send__(exception_attribute)).to have_attributes(
:all_exceptions => [
an_object_having_attributes(:message => 'expected `1.even?` to return true, got false'),
an_object_having_attributes(:message => /expected.*even\?/),
an_object_having_attributes(:class => NameError, :message => /boom/)
]
)
Expand All @@ -111,8 +111,8 @@

expect(ex.execution_result.__send__(exception_attribute)).to have_attributes(
:all_exceptions => [
an_object_having_attributes(:message => 'expected `1.even?` to return true, got false'),
an_object_having_attributes(:message => 'expected `2.odd?` to return true, got false'),
an_object_having_attributes(:message => /expected.*even\?/),
an_object_having_attributes(:message => /expected.*odd\?/),
an_object_having_attributes(:class => NameError, :message => /boom/)
]
)
Expand Down