11 Commits

Author SHA1 Message Date
Jack Nagel
27e3ab781c Clean up test classes 2014-04-06 15:55:25 -05:00
Jack Nagel
d87f1fb5ec Assert on state, not something that didn't happen 2013-10-14 21:46:21 -05:00
Jack Nagel
6090b9b2bf Silence warnings 2013-07-22 11:41:47 -05:00
Jack Nagel
e5ee7d59f5 Fix failing test 2013-06-07 20:57:07 -05:00
Jack Nagel
4adecd73b6 tests: extract common formula helper 2013-05-25 17:19:18 -05:00
Jack Nagel
bffe090b21 Don't test error message
Now that we are testing for a custom exception type, we don't need to
make any assertion about the message.
2013-04-27 14:50:35 -05:00
Jack Nagel
9b5cb6cfb6 Allow brew versions to work with underspecified formulae 2013-04-27 14:44:48 -05:00
Jack Nagel
00bcc5e8ad Make a specific assertion in this test 2013-04-13 17:40:14 -05:00
Jack Nagel
a05bb48807 Raise a useful exception for incomplete formulae 2013-04-13 17:40:14 -05:00
Jack Nagel
4bd34c9624 Allow "devel-only" formulae
It seems only natural that this should be possible, or at the very
least, it should not result in calling methods on nil.
2013-04-13 17:40:13 -05:00
Jack Nagel
2e26afe556 Improved formula attribute validation
The initializer for Formula does a number of validations, but it does
them in a weird order, and some attributes aren't validated under
certain circumstances. This became even more of a mess when most
software package attributes were moved into the SoftwareSpec class.

This commit removes the last vestiges of storing these attributes as
instance variables. In particular, it eliminates #set_instance_variable
and #validate_variable, replacing them with methods that operate on
SoftwareSpec instances, and generate more useful errors.

Doing these validations unconditionally in the initializer means we bail
out much earlier if the formula has invalid attributes or is not fully
specified, and no longer need to validate in #prefix.

Technically we don't need to validate in #brew either, but we continue
to do so anyway as a safety measure, and because we cannot enforce calls
to super in subclasses.
2013-04-13 17:40:12 -05:00