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

(#132) TextMatcherEnvelope should call asString() only once at all #147

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

victornoel
Copy link
Collaborator

This is for #132

Since there are no Sticky implementation for Text in cactoos, I simply simulated it by calling asString() in the matches method.

The problem originally appeared because it wasn't possible to test streams with text matchers so I added a test that reflected this use case.

I'm personally not very excited about the fact that TextEnvelope does so much and it is hard to test and honestly a bit brittle to do things like this, but #135 covers that matter. @paulodamaso I hope you will reconsider it since it's not in scope currently :)

@codecov
Copy link

codecov bot commented Sep 24, 2019

Codecov Report

Merging #147 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #147   +/-   ##
=========================================
  Coverage     97.68%   97.68%           
  Complexity      112      112           
=========================================
  Files            24       24           
  Lines           259      259           
  Branches          3        3           
=========================================
  Hits            253      253           
  Misses            6        6
Impacted Files Coverage Δ Complexity Δ
...lorllale/cactoos/matchers/TextMatcherEnvelope.java 100% <100%> (ø) 4 <1> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7efc9e...f04aa3b. Read the comment docs.

@0crat
Copy link
Collaborator

0crat commented Sep 24, 2019

Job #147 is now in scope, role is REV

@0crat
Copy link
Collaborator

0crat commented Sep 24, 2019

This pull request #147 is assigned to @fabriciofx/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @paulodamaso/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

Copy link

@fabriciofx fabriciofx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel can you check it out, please?

).affirm();
}

private static final class TextEquals extends TextMatcherEnvelope {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel IMHO all classes should be public. Why? Because if they're private you're obstructing the reuse of this functionalities by others parts. @paulodamaso WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriciofx it's a class that is part of the test: it's not meant to be reused. If someone wants that functionality, there is TextIs, but here the point is to te be self-sufficient with the envelope to test its behaviour. If there was any reason to reuse this class, then it would be as part of this project, since it's in the test sources, and in that case, when it is needed, we can always bring it outside of this class and then test it before making it public. But I wouldn't recommend it because it would defeat the purpose of having a self-sufficient test.

The real problem here is that TextMatcherEnvelope is an abstract class with behaviour that needs to be tested, this is not great, see #135.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriciofx @victornoel For me it's okay the way it is now; if we need to use this in he future, we can extract it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabriciofx are we good to merge then?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victornoel ok. @paulodamaso can you merge it now, please?

@fabriciofx
Copy link

@paulodamaso can you merge it, please?

@paulodamaso
Copy link
Contributor

@fabriciofx @victornoel thanks

@paulodamaso
Copy link
Contributor

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Oct 2, 2019

@rultor merge

@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit f04aa3b into llorllale:master Oct 3, 2019
@rultor
Copy link
Collaborator

rultor commented Oct 3, 2019

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 3min)

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

The job #147 is now out of scope

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

@sereshqua/z please review this job completed by @fabriciofx/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

Code review was too long (8 days), architects (@paulodamaso) were penalized, see §55

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @paulodamaso/z

@sereshqua
Copy link

@fabriciofx please make sure you will try to find at least 3 issues during next CR, thanks

@fabriciofx
Copy link

@sereshqua ok

@sereshqua
Copy link

@0crat quality acceptable

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

Order was finished, quality is "acceptable": +15 point(s) just awarded to @fabriciofx/z

@0crat
Copy link
Collaborator

0crat commented Oct 3, 2019

Quality review completed: +4 point(s) just awarded to @sereshqua/z

@victornoel victornoel deleted the 132-text-envelope-asstring branch October 5, 2019 12:10
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

Successfully merging this pull request may close these issues.

6 participants