Skip to content

Groovy should throw exception if more then one World registred #458

New issue

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

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

Already on GitHub? # to your account

Closed
Luxor opened this issue Feb 8, 2013 · 5 comments
Closed

Groovy should throw exception if more then one World registred #458

Luxor opened this issue Feb 8, 2013 · 5 comments

Comments

@Luxor
Copy link
Contributor

Luxor commented Feb 8, 2013

World { new World1() }
World { new World2() }

Second call overrides the first as GroovyBackend is able to support only one world,
we should notify user in this case.

public class GroovyBackend implements Backend {
    private Closure worldClosure;
    private Object groovyWorld;

    private Object getGroovyWorld() {
        if (groovyWorld == null) {
            groovyWorld = worldClosure == null ? new Object() : worldClosure.call();
        }
        return groovyWorld;
    }
@aslakhellesoy
Copy link
Contributor

Would you like to submit a pull request for this?

@Luxor
Copy link
Contributor Author

Luxor commented Feb 8, 2013

Sure. Will do

@Luxor
Copy link
Contributor Author

Luxor commented Feb 15, 2013

Aslak, I think there is no need in this change.
Cucumber should throw Cucumber exception if more then one World defined
Do you agree?

@aslakhellesoy
Copy link
Contributor

I think it makes sense to throw an exception if you try to clobber a previously created World be creating a new one. Feel free to close this ticket and create a pull request for the proposed change.

Luxor added a commit to Luxor/cucumber-jvm that referenced this issue Feb 15, 2013
Luxor added a commit to Luxor/cucumber-jvm that referenced this issue Feb 19, 2013
aslakhellesoy added a commit that referenced this issue Mar 10, 2013
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants