grappa-py / grappa

Behavior-oriented, expressive, human-friendly Python assertion library for the 21st century
http://grappa.rtfd.io
MIT License
134 stars 15 forks source link

Ignore chained result if not using chained operators #22

Closed h2non closed 7 years ago

h2non commented 7 years ago

The following assertion should not used chained values:

# This should pass
object | should.have.property('foo') | should.have.property('bar')

# This should fail
object | should.have.property('foo') > should.have.property('bar')
object | should.have.property('foo').that.should.be.equal('bar')
h2non commented 7 years ago

Invalid. This won't be supported in cases where the operator yields a new value. There is an extra complexibility for a feature that won't be too useful for the end user.