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 for spec/assert? #5

Closed
nwjsmith opened this issue Jul 18, 2017 · 6 comments
Closed

Support for spec/assert? #5

nwjsmith opened this issue Jul 18, 2017 · 6 comments

Comments

@nwjsmith
Copy link

Thanks for expound, it's a great addition to spec.

I've been using clojure.spec/assert in combination with Clojure's pre-conditions. Would you be interested in a PR which adds support for assertions, or is that out-of-scope for expound?

@bhb
Copy link
Owner

bhb commented Jul 18, 2017

@nwjsmith Good idea! I'm working on a PR which will add support for a number of spec features, including assert. Once that lands in master (hopefully this week), can I check back in with you and see if it would work for you?

@nwjsmith
Copy link
Author

That would be fantastic. Let me know if I can help in any way.

@bhb bhb mentioned this issue Jul 21, 2017
@bhb
Copy link
Owner

bhb commented Jul 22, 2017

@nwjsmith Would you mind trying this feature before I release?

To try it:

  1. git clone [email protected]:bhb/expound.git
  2. cd expound
  3. git checkout expound-printer
  4. lein install
  5. In client project, change dep to [expound "0.1.2"]

@bhb
Copy link
Owner

bhb commented Jul 22, 2017

I have chosen not to add an assert function directly to Expound. I may change my mind on this, but for now, I'd like to avoid mirroring the various functions in spec.

Instead, you can set the *explain-out* var like so:

(s/check-asserts true)
(set! s/*explain-out* expound/printer)
(s/assert :example.place/city 1)

@nwjsmith
Copy link
Author

Excellent, that works for me. Thanks!

@bhb
Copy link
Owner

bhb commented Jul 25, 2017

@nwjsmith Thanks for reporting this and for testing the fix!

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