Rename prop to always? #69

Closed
sol opened this Issue May 3, 2012 · 6 comments

3 participants

@sol
hspec member
sol commented May 3, 2012

I never really liked prop, because it does not really fit in when reading a specification.

spec = do
  describe "The size of a widget" $ do
    prop "is always greater or equal to 0" $ do
      \widget -> 0 <= size widget

Would always be nicer?

spec = do
  describe "The size of a widget" $ do
    always "is greater or equal to 0" $ do
      \widget -> 0 <= size widget
@fujimura
hspec member

+1 as a everyday RSpec user, but how about just alias prop to always?
Some might prefer prop than always, because prop seems to be already popular in Haskell world.

@sol
hspec member
sol commented May 3, 2012

Yes, if only for backward compatibility we should keep prop. But I'd still tend to mark it as DEPRECATED, if we decide on always. We already have two ways to insert properties (prop "..." and it "..." property), with always that would make three.

@fujimura
hspec member

Oh, three ways to property check is too much.
Agree with just deprecate it.

@nh2

Not having used RSpec before, I'd like to throw in that prop strongly suggests to me that it's about a QuickCheck property.

I'd not oppose deprecating it in favor of only it "" $ property $ ..., though.

@sol
hspec member
sol commented Sep 8, 2012

@nh2 So you mean deprecating prop, and not adding any always? I'd tend to agree.

@sol
hspec member

Ok, for me it "..." $ property $ ... works. So for simplicity I use that for my own code and e.g. in the manual. prop will stay around for backward compatibility. If somebody feels strong about changing something, please open an other ticket and we will work something out ;).

@sol sol closed this Nov 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment