Skip to content

Conversation

stevenlmcgraw
Copy link
Contributor

Draft pull request for #671


I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.

…robstoll#671

Update `assertions/builders/descriptiveWithFailureHint.kt`:

	- Add `withHelpOnFailure` and mark `withFailureHint` as deprecated
	- Add `withHelpOnFailureBasedOnSubject` and mark `withFailureHintBasedOnSubject` as deprecated
	- Add `withHelpOnFailureBasedOnDefinedSubject` and mark `withFailureHintBasedOnDefinedSubject` as deprecated

Update `atrium/logic/creating/filesystem/hints/hints.kt`:

	- Add `withHelpOnIOExceptionFailure` and mark `withIOExceptionFailureHint` as deprecated
	- Add `withHelpOnFileAttributesFailure` and mark `withFileAttributesFailureHint` as deprecated

Refactor all usages of `with*FailureHint` found to favor the `withHelpOn*Failure` version

Update `assertions/builders/DescriptiveWithBasedOnSubjectSpec.kt`:

	- Refactor text referencing deprecated methods

Update `atrium/logic/impl/DefaultFloatingPointAssertions.kt`:

	- Remove unused import for deprecated `with*FailureHint` method(s)

Update	`atrium/logic/impl/DefaultBigDecimalAssertions.kt`:

	- Remove unused import for deprecated `with*FailureHint` method(s)

Update	`atrium/logic/impl/DefaultPathAssertions.kt`:

	- Remove unused import for deprecated `with*FailureHint` method(s)
fun <T> Descriptive.DescriptionOption<Descriptive.FinalStep>.withFailureHintBasedOnDefinedSubject(
expect: Expect<T>,
failureHintFactory: (T) -> Assertion
): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep> {
return withFailureHintBasedOnSubject(expect) {
return withHelpOnFailureBasedOnSubject(expect) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would delegate to withHelpOnFailureBasedOnDefinedSubject but also fine like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @robstoll! I can change that if you would like for me to do so - I was just flipping any old with*failureHint method names to the new equivalent on all of the usages I could find to make sure I didn't introduce any unexpected changes. I'll adjust this on your signal.

@robstoll robstoll linked an issue Aug 30, 2021 that may be closed by this pull request
2 tasks
@robstoll
Copy link
Owner

@stevenlmcgraw looks good to me. Only a small thing which you can improve in case you do other things in addition (I did not have a look if you replaced everything). If you have done everything, then there is no need for the improvement and we can merge your first PR :)

@stevenlmcgraw
Copy link
Contributor Author

Howdy @robstoll ! I used the same approach you suggested to another individual in the comments for this issue, i.e., I searched the whole project in IntelliJ with the with.*Failure regex. I think I got them all, but I will sweep back through it later today to make sure I didn't miss anything.

@robstoll
Copy link
Owner

@stevenlmcgraw sounds good, let's wait to see if the build is green as well.

@codecov
Copy link

codecov bot commented Aug 30, 2021

Codecov Report

Merging #970 (74d5d92) into master (b4dc9a0) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #970      +/-   ##
============================================
- Coverage     90.89%   90.86%   -0.03%     
============================================
  Files           433      433              
  Lines          4336     4359      +23     
  Branches        217      219       +2     
============================================
+ Hits           3941     3961      +20     
- Misses          345      349       +4     
+ Partials         50       49       -1     
Flag Coverage Δ
bbc 80.17% <66.66%> (-0.43%) ⬇️
bc 80.05% <66.66%> (-0.43%) ⬇️
current 87.13% <66.66%> (-0.47%) ⬇️
current_windows 86.21% <66.66%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...li/atrium/logic/creating/filesystem/hints/hints.kt 86.81% <45.45%> (+5.77%) ⬆️
.../assertions/builders/descriptiveWithFailureHint.kt 61.36% <68.75%> (-28.64%) ⬇️
...tutteli/atrium/logic/impl/DefaultPathAssertions.kt 87.61% <80.00%> (ø)
...tteli/atrium/creating/impl/CollectingExpectImpl.kt 100.00% <100.00%> (ø)
...trium/logic/impl/DefaultFloatingPointAssertions.kt 100.00% <100.00%> (ø)
...atrium/logic/impl/DefaultIterableLikeAssertions.kt 97.14% <100.00%> (ø)
...i/atrium/logic/impl/DefaultBigDecimalAssertions.kt 100.00% <100.00%> (ø)

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 b4dc9a0...74d5d92. Read the comment docs.

@robstoll
Copy link
Owner

@stevenlmcgraw don't worry about the coverage. It's perfect if you write a test for it but it's also OK if we keep it like that

@stevenlmcgraw
Copy link
Contributor Author

@robstoll Gotcha - I don't think I would be able to get to working on some unit tests until later this week. I don't mind taking a crack at it, but I don't want to hold you up if you are looking to get this merged as quickly as possible.

@robstoll
Copy link
Owner

@stevenlmcgraw I am merging it already but a test would still be welcome. You can create a second PR with it.

In this sense, thanks for your first contribution to Atrium 👍 and don't forget to ⭐ the repo if you liked it 🙂

@robstoll robstoll marked this pull request as ready for review August 30, 2021 20:30
@robstoll robstoll merged commit 50a28dc into robstoll:master Aug 30, 2021
@stevenlmcgraw
Copy link
Contributor Author

Thanks @robstoll ! I starred it. I'll try to set aside some time outside of work to do the tests. I'll be looking at some more issues here in Atrium as well - catch you on the next one!

@robstoll
Copy link
Owner

robstoll commented Oct 7, 2021

@stevenlmcgraw ping 😉 we could use your help with other issues. Let me know in case you need help

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.

rename withFailureHint to withHelpOnFailure
2 participants