must vs will

| | Comments (1)

John Barnette made a suggestion I like: will vs wont.

Do you like that better than must vs wont? I think I do, but it might be too visually similar. I'm not sure. Check it:

(6 * 7).must_equal 42
(6 * 9).wont_equal 42

vs.

(6 * 7).will_equal 42
(6 * 9).wont_equal 42

I think it looks OK so far.

Also, I added a simple little mapping system to make morphing the assertions into specifications more readable:

Object.infect(:must, :wont,
              /(throw)s/              => '\1',
              /must_(.*_of|nil|same)/ => 'must_be_\1',
              /must_not_(nil|same)/   => 'must_not_be_\1',
              /wont_(nil|same)/       => 'wont_be_\1',
              /must_in_delta/         => 'must_be_close_to',
              /must_no_match/         => 'must_not_match',
              /must_operator/         => 'must_be',
/^(wont|must(_(block|raises|nothing_(raised|thrown)))?)$/ => :skip)

1 Comments

Irrespective of what it's paired with, I'm not a fan of "wont": contractions without their apostrophes look a little ugly.

More importantly, "wont" without the apostrophe is a word in its own right, and sort of means the reverse of "won't", too: "6 * 7 is wont to equal 42 but 6 * 9 won't equal 42". ;)

Leave a comment

About this Entry

This page contains a single entry by zenspider published on April 28, 2008 10:57 AM.

deny, refute, debunk was the previous entry in this blog.

one more thing is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.32-en