The answer to this is tied up in the answer to your previous question -
basically the difference between class-level behaviour and story-level
behaviour (scenarios), so I'll address both in the same answer.

Cheers,
Dan

Alexandre Martins wrote:
I have a question about implementing an outcome which is an error (exception) to the user, like the following:

Scenario: user without permission creating a Product
Given system is running
And user is logged in whithout administrator privileges
When user creates a Product
Then user should get permission denied error

I've created a UserShouldGetPermissionDeniedErrorCreatingProduct outcome, which implementation is:

    public void verify(World world) {
        try {
            ensureThrows(PermissionDeniedException.class, new Block(){
                public void run() throws Exception {
                    // the statement which throw exception....
                }
            });
        } catch (Exception e) {
            // what to do here?
        }
    }

Is it a good idea? Anyone could opine about this, please?
Thanks.

Happy New Year!
Cheers.

--
______________________
Alexandre Martins Nunes



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to