• dave08

    dave08

    11 months ago
    How's about something like this to help in asserting against sealed classes/interfaces children types (not too sure about the name though...), I seem to do this alot...:
    inline fun <reified T, R> Assertion.Builder<*>.getFromA(noinline function: T.() -> R): Assertion.Builder<R> =
            isA<T>().get(function.describe(), function)
    dave08
    1 replies
    Copy to Clipboard
  • robfletcher

    robfletcher

    11 months ago
    would it make sense to restrict
    T
    to being a subtype of whatever the current subject is?
    robfletcher
    christophsturm
    10 replies
    Copy to Clipboard
  • christophsturm

    christophsturm

    10 months ago
    in strikt how would i assert that an Optional does not contain a Throwable, and when it does print the throwable including stacktrace?
    christophsturm
    4 replies
    Copy to Clipboard
  • christophsturm

    christophsturm

    10 months ago
    how would i assert that in a list one element comes before the other?
    expectThat(listOf(A,B,C)) {
      get {indexOf(A)}.isLowerThan(….)
    }
    christophsturm
    robfletcher
    5 replies
    Copy to Clipboard
  • robfletcher

    robfletcher

    7 months ago
    Couldn't you just do
    expectThat(data).dataAssertion()
    robfletcher
    e
    7 replies
    Copy to Clipboard
  • robfletcher

    robfletcher

    7 months ago
    huh, that overload looks pointless. I should be able to remove the 2nd version of that method
    robfletcher
    christophsturm
    +3
    32 replies
    Copy to Clipboard
  • e

    Eric

    7 months ago
    Any input on how to ditch the
    unwrap
    ? If so, is this ^ worth a PR?
    e
    robfletcher
    6 replies
    Copy to Clipboard
  • alightgoesout

    alightgoesout

    7 months ago
    Hello, When using JUnit assertions, Intellij adds "see difference" button to check the expected and actual values, but when using strikt it does not, which is annoying for long values. Is there a way to make Intellij add the "see difference" button when using strikt?
    alightgoesout
    christophsturm
    +2
    9 replies
    Copy to Clipboard
  • Frank Coutinho

    Frank Coutinho

    7 months ago
    Hello 😁 I'm trying to do some asserts using BigDecimal. Hope you guys can help me out
    Frank Coutinho
    3 replies
    Copy to Clipboard
  • e

    Eric

    6 months ago
    what’s the proper way to chain assertions on unrelated subjects?
    expect {
        expectThat(foo) {
            // ...
        }
        expectThat(bar) {
            // ...
        }
    }
    e
    1 replies
    Copy to Clipboard