parroty / excheck

Property-based testing library for Elixir (QuickCheck style).
MIT License
316 stars 26 forks source link

`property` with ex_unit context binding #6

Closed jtmoulia closed 9 years ago

jtmoulia commented 9 years ago

Hey, it'd be useful if an excheck property could accept the ExUnit.Case context.

For example:

property :foo, %{bar: baz} do
  ...
end

I hate to admit it, but I tried and failed to pull this off by following ex_unit's example. S'pose I should read that metaprogramming elixir book.

parroty commented 9 years ago

Thanks for the comment. I'll be looking into it.

parroty commented 9 years ago

I tried to refer the context variable from the ExUnit, though I'm not confident. Does this make sense?

jtmoulia commented 9 years ago

Perfect. Thanks for the help and for excheck -- I love using it.

parroty commented 9 years ago

Thanks! Any feedbacks are appreciated as I'm yet at learning step about property-based testing..

wkhere commented 9 years ago

Mmm I just started to need this one. Thx for implementing! [:

wkhere commented 9 years ago

Can you also publish v0.2.2 containing this to Hex?

parroty commented 9 years ago

I think this one is included in the v0.2.1.

wkhere commented 9 years ago

Ahh now I see. You're right [:

The misunderstanding comes from how people version things. One strict semver way is putting 0.42.1 into mix only when it really becomes this ver, tagging it, and immediately starting with 0.42.2-dev.

This has an advantage that a commit where the ver is switched is also a point where it really is this new ver - handy for people looking at your commits.

The other, more relaxed way, is after releasing v0.42.1 mark new ver as 0.42.2. Still one information is lost -- that this is in-development version -- in fact not lost but requires scanning through commits history in order to grasp it, instead of just having one look into mix.exs or whatever thing which provides version number.

Just 3cents [:

parroty commented 9 years ago

One strict semver way is putting 0.42.1 into mix only when it really becomes this ver, tagging it, and immediately starting with 0.42.2-dev.

I am seeing the elixir is taking this approach, but I'm thinking a little too much for small number of commit ones.

The other, more relaxed way, is after releasing v0.42.1 mark new ver as 0.42.2.

I'm taking this one (mainly for not forgetting incrementing version...), and the tag is matched with hex-release.

wkhere commented 9 years ago

Ok, thx for the clarification!