Skip to content

Commit

Permalink
Relax aggregate failures expectations on messages
Browse files Browse the repository at this point in the history
The exact message isn't important and makes this brittle.
  • Loading branch information
JonRowe committed Sep 3, 2020
1 parent 8f29def commit db9fa63
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit db9fa63

Please sign in to comment.