Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert WithData to testContainer level #4003

Open
maxtar opened this issue May 6, 2024 · 4 comments
Open

Revert WithData to testContainer level #4003

maxtar opened this issue May 6, 2024 · 4 comments
Assignees

Comments

@maxtar
Copy link

maxtar commented May 6, 2024

Please describe the feature you'd like to see including any solutions in mind if you have any
Before 5 version kotest have ability writing steps in withData section. For example:

"Test withData" - {
  withData(
    listOf(
      PythagTriple(3, 4, 5),
      PythagTriple(6, 8, 10),
    )
  ){ (a, b, c) ->
   "Do something" {
       ...
    }
   "Check isPythagTriple" {
       isPythagTriple(a, b, c) shouldBe true
    }
  }
}

But in 5.8 version this code drop error suspend infix operator fun String.invoke(test: suspend FreeSpecTerminalScope.() -> Unit): Unit' can't be called in this context by implicit receiver. Use the explicit one if necessary

Please revert to old behaviour. It's more usable.

@Kantis
Copy link
Member

Kantis commented May 8, 2024

Duplicates #3901

@Kantis Kantis closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
@maxtar
Copy link
Author

maxtar commented May 13, 2024

@Kantis is it really the same that #3901? I'm talking about withData body, but in #3901 mentioned arguments.

@Kantis
Copy link
Member

Kantis commented May 13, 2024

If you make sure there's at least two arguments to withData, does it not work?

"Test withData" - {
  withData(
      PythagTriple(3, 4, 5),
      PythagTriple(6, 8, 10),
  ){ (a, b, c) ->
   "Do something" {
       ...
    }
   "Check isPythagTriple" {
       isPythagTriple(a, b, c) shouldBe true
    }
  }
}

@maxtar
Copy link
Author

maxtar commented May 13, 2024

Nope. The same error

@Kantis Kantis self-assigned this May 15, 2024
@Kantis Kantis reopened this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants