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

beforeProject / afterProject in TestListener is confusing #859

Closed
sksamuel opened this issue Jun 22, 2019 · 5 comments
Closed

beforeProject / afterProject in TestListener is confusing #859

sksamuel opened this issue Jun 22, 2019 · 5 comments
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Milestone

Comments

@sksamuel
Copy link
Member

These methods won't be invoked in a test listener, so they should be in some kind of project listener.

@sksamuel sksamuel added bug 🐛 Issues that report a problem or error in the code. enhancement ✨ Suggestions for adding new features or improving existing ones. labels Jun 22, 2019
@alladywek
Copy link
Contributor

small example:

class A : StringSpec() {

    override fun listeners(): List<TestListener> = listOf(object : TestListener {
        override fun beforeProject() {
            println("before project")
        }

        override fun afterProject() {
            println("after project")
        }
    })

    init {
        "test1" {
            println("test")
        }
    }
}

// will print:
// test

@LeoColman LeoColman removed the bug 🐛 Issues that report a problem or error in the code. label Jun 25, 2019
@LeoColman
Copy link
Member

I removed the bug label, I don't think this is a bug.

It's confusing tho xD

@LeoColman
Copy link
Member

How to deprecate this without breaking client code?

Currently, any user is implementing project listeners using the TestListener.

@sksamuel
Copy link
Member Author

sksamuel commented Jun 25, 2019 via email

@sksamuel sksamuel added this to the 3.4 milestone Jun 30, 2019
@sksamuel sksamuel mentioned this issue Jun 30, 2019
39 tasks
sksamuel added a commit that referenced this issue Jul 14, 2019
@sksamuel
Copy link
Member Author

Added ProjectListener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

No branches or pull requests

3 participants