Atrium: shortcut for Path.resolve

Created on 16 Oct 2019  路  8Comments  路  Source: robstoll/atrium

Platform (jvm, js, android): jvm
Extension (none, kotlin 1.3, jdk8): jdk8

Code related feature

expect(Paths.get("folder")).resolve("file.txt").exists()
expect(Paths.get("folder")).resolve("file.txt") {
    isReadable()
    isWriteable()
}

//instead of

expect(Paths.get("folder")).feature { f<String, Path>(it::resolve, "file.txt") }.exists()
expect(Paths.get("folder")).feature({ f<String, Path>(it::resolve, "file.txt") }) {
    isReadable()
    isWriteable()
}

Following the things you need to do:

lib

  • implement _resolve in PathAssertions by using ExpectImpl.feature.f1

domain

  • extend PathAssertions with a function resolve (see existing functions as a guideline)
  • modify PathAssertionsBuilder, delegate to PathAssertions (see existing functions as a guideline)
  • delegate implementation to robstoll-lib in PathAssertionsImpl (see existing functions as a guideline)

api

  • provide a fun which expects a String and returns Expect (see listAssertions.kt -> get as a guideline)
  • provide a fun which expects a String plus an assertionCreator-lambda and returns Expect where T: Path (see listAssertions.kt -> get as a guideline)
  • add @since 0.10.0 to KDOC
  • add the function also to api-infix-en_GB-jdk8
  • add your new functionality to PathFeatureAssertionsSpec in specs-common

    • extend it in atrium-api-fluent-en_GB-jdk8-jvm/src/test

    • extend it in atrium-api-infix-en_GB-jdk8-jvm/src/test

Your first contribution?

  • Write a comment I'll work on this if you would like to take this issue over.
    This way we get the chance to revise the description in case things have changed in the meantime,
    we might give you additional hints and we can assign the task to you, so that others do not start as well.
  • See Your first code contribution for guidelines.
  • Do not hesitate to ask questions here or to contact us via Atrium's slack channel if you need help
    (Invite yourself in case you do not have an account yet).
good first issue help wanted

All 8 comments

Hi, I like to work on this task

@Keerthi4308 do you need help? I am un-assigning you as I did not get a reaction. Comment here if you still work on it or would like to work on it, I'll re-assign it to you then.

Hi @robstoll I'll work on this

@aljacinto do you need any help?

Sorry @robstoll, got busy. Can you reassign to someone else?

I will work on this!

@slalu I updated the description, I am going to add a bit more description for the infix API later on.

implemented with 9cb8c5de

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robstoll picture robstoll  路  4Comments

robstoll picture robstoll  路  5Comments

robstoll picture robstoll  路  6Comments

robstoll picture robstoll  路  5Comments

dalewking picture dalewking  路  6Comments