joshgoebel / wren-testie

Simple and beautiful testing for Wren
MIT License
8 stars 2 forks source link

(enh) Add negated equality methods #3

Closed joshgoebel closed 3 years ago

joshgoebel commented 3 years ago

Resolves #2.

joshgoebel commented 3 years ago

Just to make it easier to pull.

joshgoebel commented 3 years ago

abortsWith, toNotAbort

We perhaps should add toAbortWith and deprecate abortsWith (as much as I really like it)... or else reword the negative case... but having them not match is gonna bug me. :)

glennj commented 3 years ago

abortsWith, toNotAbort

We perhaps should add toAbortWith and deprecate abortsWith (as much as I really like it)... or else reword the negative case... but having them not match is gonna bug me. :)

notwithstanding "I'm generally no fan of abbreviations", perhaps

Expect.that {something}.abortsWith(err)
Expect.that {something}.doesntAbort()

That opens up the possibility for

joshgoebel commented 3 years ago
toBe => is

Nope, is is a keyword in Wren... that's why I stayed away from that shorter style... cause if we can't have is... it just makes me wanna cry. :)

joshgoebel commented 3 years ago
Expect.that {something}.abortsWith(err)
Expect.that {something}.doesNotAbort()

I could be talked into doesNot. :-) Contractions are a whole other thing than abbreviations. (though perhaps they are a subclass?)

joshgoebel commented 3 years ago

Though perhaps equals is still nice without is?

and so on

You have me wondering what the "and so on" would be. This is why I avoided isGreaterThan and friends though if we can't have simply is for consistency...

glennj commented 3 years ago

Hmm

Let me throw on my shell/perl hat for fun (and your horror, I'm sure)

joshgoebel commented 3 years ago
equals, doesNotEqual
isGreaterThan, isLessThan, isGreaterThanOrEqual, isLessThanOrEqual
isNull, isNotNull
hasSameItemsAs
abortsWith, doesNotAbort

These look nice, shouldn't this also include isEqual and isNotEqual though?

joshgoebel commented 3 years ago

Regarding just the negation bits I think this is looking pretty good now though. Thoughts?

Since I opened the PR you'll need to approve it, LOL.

glennj commented 3 years ago

I'm happy with it. Did you want to include the less-format aliases first?

joshgoebel commented 3 years ago

https://github.com/joshgoebel/wren-testie/pull/3#issuecomment-907500977

These? We can... though they aren't strictly related to negation... PRs tend to get squashed so the history might be nicer if we had diff PRs for these major things.

joshgoebel commented 3 years ago

If this is going to start changing all the time now I need to figure out better release management, changelog, etc. :)