dart-lang / matcher

A declarative API for specifying expectations.
https://pub.dev/packages/matcher
BSD 3-Clause "New" or "Revised" License
69 stars 37 forks source link

0.12.0 has pretty hard breaking changes #2

Closed zoechi closed 9 years ago

zoechi commented 9 years ago

https://github.com/dart-lang/matcher/blob/14747b0658911cd55d140ba966653f9fbc915eab/CHANGELOG.md#0120

This will prevent using the testrunner for a while, at least until all packages which use one of those moved classes are available in a fixed version.

I run into this in a project where I use shelf_auth.

Is there any way to keep them with a deprecation annotation for a while?

zoechi commented 9 years ago

I couldn't find the classes (for example FailureHandler) in unittest 0.12.0 either.

nex3 commented 9 years ago

I'm shocked that anyone was using these definitions to begin with. They were only really intended for use in the glue code between matcher and unittest, not for wider consumption, which is largely why they've been removed.

How are your packages using them?

zoechi commented 9 years ago

It's not my package and I have no idea the classrs are used. I just run into that issue while trying testrunner with my project which has shelf_auth as a dependency. I created an issue in the shelf_auth bitbucket repo with a link to this issue.

Andersmholmgren commented 9 years ago

I use expect for precondition checking quite extensively. Moving this out of matcher is gonna cause me a lot of pain (sadpanda)

nex3 commented 9 years ago

I'm closing this out, since there aren't any plans to put this stuff back in matcher.

@Andersmholmgren expect() throws a TestFailure, which doesn't really make sense for generic matching. Honestly, it doesn't do much beyond throwing that exception, so it would be pretty easy to write a custom version that throws an ArgumentError or whatever instead.

Andersmholmgren commented 9 years ago

I plug my in failure handler in to throw an ArgumentError already. I'll just have to port over some of the logic of expect

zoechi commented 9 years ago

The mock package runs into the same/similar problem. The source code for this package is not available. Any plans to update this package for the new test package?

zoechi commented 9 years ago

I created http://dartbug.com/23106