Platform (jvm, js, android): jvm
Extension (none, kotlin 1.3): none
Follow up of #375, we want the corresponding functionality in api-infix as well
expect(path) hasSameTextualContentAs path
expect(path) hasSameTextualContentAs withEncoding(path, sourceEncoding=..., targetEncoding=...)
expect(path) hasSameBinaryContentAs path
api-infix
@since 0.12.0 to @since 0.13.0 (adapt to current milestone) and split hasSameTextualContentAs into two functions:targetPath: PathEncodingWithCreator which you need to create (see PathWithCreator for guidelines)withEncoding(targetPath: Path, sourceCharset: Charset = Charsets.UTF_8, targetCharset: Charset = Charsets.UTF_8) which creates an EncodingWithCreator (see helper function path in pathAssertions.kt)not supported in this API and use the newly added functions insteadI'll work on this if you would like to take this issue over.@assaflei do you fancy implementing this one?
I'll work on this
Hello
I have a question regarding splitting "hasSameTextualContentAs" function:
first one with only path parameter is unused, because in PathAssertionsSpec.kt there is only one parameter for given function. Is this normal?
there is only one parameter for given function
I am not sure what you mean by that but you are right that we have only
hasSameTextualContentAs: Fun3<Path, Path, Charset, Charset>,
Which expects 3 arguments. I.e we have not checked that the default arguments are UTF-8. Let's add this. Would you mind doing this? Otherwise I can add it for you and you can rebase afterwards.
Add hasSameTextualContentAsDefaultArgs: Fun1<Path, Path>, to misc/specs/atrium-specs-jvm/src/main/kotlin/ch/tutteli/atrium/specs/integration/PathAssertionsSpec.kt
Add a test case to:
context("empty content") { -- should not throwcontext("has same binary content") { -- should not throw (basically same as it("${hasSameTextualContentAs.name} - does not throw if UTF-8, UTF-8 is used")context("has same textual content in UTF-8 and UTF-16") { -- should throwcontext("has different textual content") { should throw No prob. I'll add hasSameTextualContentAsDefaultArgs by myself. thanks for offering your help ^^
@z13z I just realised we don't have hasSameBinaryContentAs in infix either. How about you create a second PR (or include it in your first as you wish)?
implemented with https://github.com/robstoll/atrium/pull/557