Atrium: Migrate Spek1 specs to Spek2

Created on 12 Aug 2019  路  5Comments  路  Source: robstoll/atrium

Platform (jvm, jdk8, js, android): jvm

Test-Code related issue

We have not yet migrated all specs to spek2.
Following a list modules in which there are still spek1 specs

  • atrium-core-robstoll-lib-jvm
  • atrium-domain-robstoll-lib-jvm

Search for import org.jetbrains.spek.api.Spekand for TODO #116 to find those specs

TODO:

  • copy the spec from misc/atrium-spec to misc/specs/atrium-specs-common or move it
    from misc/atrium-specs-jvm to misc/atrium-specs-common
  • migrate the spec, which most of the time involves:

    • search for import org.jetbrains.spek.api.Spek replace with import org.spekframework.spek2.Spek

    • search for import org.jetbrains.spek.api.include replace with import ch.tutteli.atrium.specs.include

    • search for import ch.tutteli.atrium.verbs.internal.AssertionVerbFactory replace with import ch.tutteli.atrium.api.verbs.internal.AssertionVerbFactory

    • search for import ch.tutteli.atrium.spec. replace with import ch.tutteli.atrium.specs

    • search for test( replace with it(

    • search for group( replace with context(

    • search for on( repalce with context(

    • search for verbs.checkImmediately replace with verbs.check

    • rewrite describeFun => see https://github.com/robstoll/atrium/pull/209/files#diff-676c33efc276af1070bfde5d55307d9dR23

    • plus some further adjustments like import describe

See https://spekframework.org/migration/ for additional hints on the topic

Your first contribution?

good first issue help wanted

All 5 comments

Hey @robstoll, I would love working on this.

@monst12 nice :+1: I suggest you start off by migrating one spek and create a PR for it before you move on to the next one.

Hi @robstoll I would like to work on this issue, how do you suggest I should get started?

Hi @assaflei

How about you start with the following (all very similar):

  • bundles/fluent-en_GB/atrium-fluent-en_GB-jvm/src/test/kotlin/custom/SmokeSpec.kt
  • bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-kotlin_1_3/src/test/kotlin/custom/SmokeSpec.kt
  • bundles/fluent-en_GB/extensions/atrium-fluent-en_GB-smoke-test-jdk8/src/test/kotlin/custom/SmokeSpec.kt

Those should be very easy (not much more than changing the import I guess but you will see).
After those you could continue with (a second PR):
core/robstoll-lib/atrium-core-robstoll-lib-jvm/src/test/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/DetailedObjectFormatterSpec.kt

The following commit shows what was necessary to migrate DelegatingAssertionCheckerSpec which is probably similar:
https://github.com/robstoll/atrium/pull/209/files

Also have a look at the hints in the description of this issue. Let me know in case you need more help

All necessary specs have been migrated, closing this. Follow up for moving things will follow

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robstoll picture robstoll  路  7Comments

robstoll picture robstoll  路  4Comments

dalewking picture dalewking  路  6Comments

robstoll picture robstoll  路  4Comments

robstoll picture robstoll  路  6Comments