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

Support Test::Deep expectations #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

happy-barney
Copy link

Test::Deep provides nice support for writing complex expectations
that comes handy especially when system under test throws objects

    throws_ok
        { code that should throw exception }
        all (
            obj_isa ('Expected::Exception::Instance'),
            methods (
                errcode => 400,
                errstr  => re (qr/foo/),
            )
        ),
        'description'
        ;

Test::Deep is not dependency of Test::Exception, it is only recognized
and used then assuming library is already loaded.

Test::Deep provides nice support for writing complex expectations
that comes handy especially when system under test throws objects

```
    throws_ok
        { code that should throw exception }
        all (
            obj_isa ('Expected::Exception::Instance'),
            methods (
                errcode => 400,
                errstr  => re (qr/foo/),
            )
        ),
        'description'
        ;
```

Test::Deep is not dependency of Test::Exception, it is only recognized
and used then assuming library is already loaded.
@exodist
Copy link
Member

exodist commented May 14, 2019

I do not think this should be part of Test::Exception. Test::Exception at this point is fairly legacy, changing it has the potential to effect a lot of things in unintentional ways. Further there are other libraries like Test::Fatal and the equivelent in Test2::Suite, and a couple others which are recommended over Test::Exception.

Test::Exception has to do a few ugly things that the other libraries avoid by a significantly better interface design.

Adding Test::Deep as a testing/development dependency almost certainly creates a dependency cycle.

Also, even Test::Deep has alternatives these days (I wrote one of them), it is not practical to make every legacy library like Test::Exception support all of them.

I am not going to close this outright, if other Test::Exception contributors/maintainers support this change in full or part I am open to listening to people who disagree with me, and do not intend to fight this with any vigor, but I do not think it is a necessary change for such an old library.

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

Successfully merging this pull request may close these issues.

2 participants