Open Jonplussed opened 9 years ago
Hey, Yes, you are right. I already started in that direction on branch https://github.com/hspec/hspec-wai/tree/re-exports. Do you want to take a look, augment it if needed and open a PR?
After inspecting, the only functions missing seemed to be the expectations in hspec-expectations
, which just need lifting to work within a WaiExpectation
. Addressed in https://github.com/hspec/hspec-wai/pull/24.
I reverted this, because from my perspective it's not entirely clear what we would need to re-export and what not (e.g. what about hooks). The underlying issues as I see it is that re-exporting everything dose not compose well.
The current situation is not ideal, as we have a name conflict for pending
and pendingWith
, so I hope we can come up with something better in the future (maybe finding module boundaries where a user can import the things he wants to use).
(read: I acknowledge that there is a problem we need to fix, but right now I need to cut a release and I don't know what the right solution is.)
@sol No problem; happy to contribute ideas regardless. Thanks for all of your work on Hspec.
Rather than requiring conflicting imports from both
Test.Hspec
andTest.Hspec.Wai
,Test.Hspec.Wai
could export all ofTest.Hspec
, replacing the functions that need lifting, such asrender
orshouldBe
, with the lifted versions.This seems unlikely to cause problems, since anybody using both test suites in the same file should probably have them qualified to avoid conflicts even in the current iteration. Will send a pull if going this route sounds worthwhile to you.