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

Test.Hspec.Wai should shadow lifted Test.Hspec functions #22

Open
Jonplussed opened this issue Oct 24, 2014 · 4 comments
Open

Test.Hspec.Wai should shadow lifted Test.Hspec functions #22

Jonplussed opened this issue Oct 24, 2014 · 4 comments

Comments

@Jonplussed
Copy link
Contributor

Rather than requiring conflicting imports from both Test.Hspec and Test.Hspec.Wai, Test.Hspec.Wai could export all of Test.Hspec, replacing the functions that need lifting, such as render or shouldBe, 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.

@sol
Copy link
Member

sol commented Oct 25, 2014

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?

@Jonplussed
Copy link
Contributor Author

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 #24.

@sol
Copy link
Member

sol commented Nov 14, 2014

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.)

@Jonplussed
Copy link
Contributor Author

@sol No problem; happy to contribute ideas regardless. Thanks for all of your work on Hspec.

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

No branches or pull requests

2 participants