-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
#630 add Path.isRelative method #632
Conversation
...um-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
...-api-infix-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathAssertionsSpec.kt
Outdated
Show resolved
Hide resolved
.../atrium-logic-jvm/src/main/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt
Outdated
Show resolved
Hide resolved
de7b04f
to
aac6b01
Compare
...lations-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/translations/DescriptionPathAssertion.kt
Outdated
Show resolved
Hide resolved
...lations-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/translations/DescriptionPathAssertion.kt
Outdated
Show resolved
Hide resolved
Can you also add the German translations? They are |
...rium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
Ja wohl |
.../atrium-api-infix-en_GB-common/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/keywords.kt
Show resolved
Hide resolved
09c7da5
to
af317a5
Compare
@jakubriegel the PR looks good but the CI fails 😉 |
af317a5
to
5249e8f
Compare
@robstoll trying to fix it with |
@jGleitz do you have time to take a look why it fails on linux? |
5249e8f
to
1572899
Compare
@jakubriegel btw. GitHub actions is Windows |
@@ -147,6 +150,17 @@ class DefaultPathAssertions : PathAssertions { | |||
.build() | |||
} | |||
|
|||
private inline fun <T : Path> pathTypeAssertion( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is basically the same as fileTypeAssertion - can please you introduce a ioResultAssertion function which takes a typeTest: (IOResult<BasicFileAttribute>) -> Boolean
can call it from file... and pathTypeAssertion
...s/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/PathAssertionsSpec.kt
Outdated
Show resolved
Hide resolved
logic/atrium-logic-jvm/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultPathAssertions.kt
Outdated
Show resolved
Hide resolved
...s/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/PathAssertionsSpec.kt
Outdated
Show resolved
Hide resolved
...um-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
...rium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
579a0e7
to
2e228fd
Compare
...um-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
...rium-api-infix-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/infix/en_GB/pathAssertions.kt
Outdated
Show resolved
Hide resolved
provider: SubjectProvider<Path> | ||
): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep> = | ||
withFailureHintBasedOnDefinedSubject(provider) { path -> | ||
explainForResolvedLink(path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think explainForResolvedLink
is correct here. The assertion does not resolve symlinks (right?), so there should also be no explanation about the resolved target. The assertion should only be about the path itself, regardless of the file system content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified to
fun Descriptive.DescriptionOption<Descriptive.FinalStep>.withPathAttributesFailureHint(
provider: SubjectProvider<Path>
): Descriptive.DescriptionOption<DescriptiveAssertionWithFailureHint.FinalStep> =
withFailureHintBasedOnDefinedSubject(provider) { path ->
describeWas(path.type)
.let {
assertionBuilder.explanatoryGroup.withDefaultType
.withAssertions(listOf(it))
.build()
}
}
.../atrium-logic-jvm/src/main/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt
Outdated
Show resolved
Hide resolved
6bf3320
to
1554303
Compare
logic/atrium-logic-jvm/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultPathAssertions.kt
Outdated
Show resolved
Hide resolved
1554303
to
ad40f50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After all the confusion, I think this PR is almost ready. I only found nit picks.
@jakubriegel you might want to consider configuring your IntelliJ to clean up imports before you commit:
...s/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/PathAssertionsSpec.kt
Outdated
Show resolved
Hide resolved
...en_GB-jdk8-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/jdk8/PathAssertionsSpec.kt
Outdated
Show resolved
Hide resolved
import ch.tutteli.atrium.logic.creating.transformers.impl.ThrowableThrownFailureHandler | ||
import ch.tutteli.atrium.logic.creating.filesystem.Failure | ||
import ch.tutteli.atrium.logic.creating.filesystem.IoResult | ||
import ch.tutteli.atrium.logic.creating.filesystem.Success | ||
import ch.tutteli.atrium.reporting.translating.Translatable | ||
import ch.tutteli.atrium.translations.DescriptionBasic | ||
import ch.tutteli.atrium.translations.DescriptionPathAssertion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the added imports, they should now be obsolete, right?
@@ -19,6 +19,7 @@ import org.spekframework.spek2.dsl.Skip.No | |||
import org.spekframework.spek2.dsl.Skip.Yes | |||
import org.spekframework.spek2.dsl.TestBody | |||
import org.spekframework.spek2.style.specification.Suite | |||
import java.io.File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unused import, isn’t it? If yes, please remove it!
@jGleitz I will try with import optimization, but I've turned it off, cause I didn't want to mess with existing conventions |
e000f87
to
99831bc
Compare
Codecov Report
@@ Coverage Diff @@
## master #632 +/- ##
============================================
- Coverage 87.34% 87.10% -0.24%
Complexity 16 16
============================================
Files 903 903
Lines 8116 8121 +5
Branches 374 374
============================================
- Hits 7089 7074 -15
- Misses 949 968 +19
- Partials 78 79 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
d096e3a
to
ec235d0
Compare
@jakubriegel thanks and congrats to your first contribution to Atrium 🎉 |
Thanks @robstoll and @jGleitz for providing me with opportunity! It was my first hactoberfest contribution and I hope not last 😃 |
Add
Path.isRelative()
for assertions and both APIs. From issue #630Changes may be helpful for to #629
I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.