Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premature calculation of actual description when generating matcher description #204

Open
jas14 opened this issue Jan 1, 2024 · 0 comments

Comments

@jas14
Copy link
Contributor

jas14 commented Jan 1, 2024

In cases where the example passes, SuperDiff::RSpec::AugmentedMatcher#description appears to generate the description of the actual object via a call to matcher_text_builder_args:

actual: actual_for_matcher_text,

However, the MatcherTextBuilders::Base#matcher_description doesn't use said description:

def matcher_description
template =
MatcherTextTemplate.new do |t|
t.add_text expected_action_for_description
add_expected_value_to_description(t)
add_extra_after_expected_to(t)
end
Csi.decolorize(template.to_s(as_single_line: true))
end

This can incur a substantial delay in cases where the inspection of the actual object takes a lot of time (e.g. #160).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant