Skip to content

Making withRunningKafka easy to use in withFixture #25

@chris-zen

Description

@chris-zen

Hi @manub, today reading the ScalaTest docs for sharing fixtures I realised that the signature of withRunningKafka does not allow to use it in an override of the ScalaTest withFixture. With a simple change in the signature I am guessing it would work (I didn't check it, but with other fixtures of mine it worked):

// Small modification replacing [=> Unit] by [=> Any]
def withRunningKafka(body: => Any)(implicit config: EmbeddedKafkaConfig)
// In the Spec

"something" should "satisfy something" in {
  // kafka is running here
}

override def withFixture(test: NoArgTest) = {
  withRunningKafka {
    withOtherFixture {
      super.withFixture(test)
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions