Commit Graph
42 Commits
Author SHA1 Message Date
Jack Nagel 54e6140a18 Add tests for Formula#installed_prefix 2013-05-25 17:19:19 -05:00
Jack Nagel b596f73c03 Add tests for FormulaPin and simplify implementation 2013-04-16 01:58:11 -05:00
Jack Nagel ef4de70a5f Remove obsolete tests
This behavior is now tested at more appropriate levels in
test_software_spec, test_formula_spec_selection, and
test_formula_validation.
2013-04-13 18:23:06 -05:00
Jack Nagel 563d8be6bd 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
Jack Nagel f3272fe14b Eliminate test_bucket
Most of the behavior tested here is now tested elsewhere. Move the
remaining useful tests to better places.
2013-04-10 22:27:56 -05:00
Jack Nagel f96d8e99d5 Make test formulae initializers more flexible 2013-04-10 12:02:35 -05:00
Jack Nagel 2323dfdac1 Move formula equality tests out of test_bucket 2013-04-10 12:02:35 -05:00
Jack Nagel 0dd8fe8928 Check existence rather than rescue exceptions 2013-04-09 19:40:08 -05:00
Jack Nagel cdbc57aac7 Clean up mirror support test 2013-04-08 19:15:22 -05:00
Jack Nagel 8510120f07 Fix specs in TestBall 2013-04-08 17:43:01 -05:00
Jack Nagel 1953e403f3 Ensure ARGV is cleaned up 2013-04-08 00:27:47 -05:00
Jack Nagel a21376f31f Simplify tests 2013-04-07 20:59:52 -05:00
Jack Nagel 56d5735b09 Don't use "assert_not_nil" 2013-04-02 15:33:34 -05:00
Jack Nagel 911fb61872 Silence stderr in test suite 2013-04-01 12:15:29 -05:00
Jack Nagel 1e9fb46212 Suppress ambiguous argument and grouped expression warnings 2013-03-28 17:37:29 -05:00
Jack Nagel 31fd139e57 Simplify SoftwareSpec checksum methods
Reader methods for specific checksum types have been absent from the
Formula class for some time, so there isn't any reason to expose them in
SoftwareSpec, either.

Thus, these methods now only act as setters, and #checksum should be
used to access the constructed Checksum object.
2013-03-18 15:10:36 -05:00
Jack Nagel 7b055a34fb Fix tests under 32-bit SL 2013-03-09 17:38:45 -06:00
Jack Nagel 33393a2597 Remove unused variables 2013-02-18 12:13:35 -06:00
Jack Nagel d39678612f Avoid nil in URL specs 2013-02-11 20:52:07 -06:00
Mike McQuaid 1da2d5dd92 Remove MD5 support.
Closes #17317.
2013-01-30 22:36:12 -08:00
Mike McQuaid 3318b08a2e Don't use underscores in (new) bottle filenames.
Closes #14270
2013-01-29 17:14:09 -08:00
Mike McQuaid e9eac42daa Cleanup old bottle syntax. 2013-01-29 17:14:00 -08:00
Jack Nagel eeac119622 tests: set newly-visible global constants
The changes to error ouput and logging require a few more things to be
visible during installation tests.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-29 12:14:57 -05:00
Jack Nagel db7a800130 Add support for custom version schemes
A version scheme is a class that inherits from Version and reimplements
Version#<=>. This will allow formulae to specify a custom comparison
method that will be used instead of the default, for cases where the
default is insufficient.
2012-08-18 11:12:09 -05:00
Jack Nagel 9e80ec2c11 Add Version#detected_from_url? 2012-08-18 11:12:09 -05:00
Jack Nagel 4affbabfb7 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel e6b97bebd9 Deprecate ancient formula syntax
Closes #13444.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-09 23:56:54 -05:00
Jack Nagel 0a82dd690b tests: expect that mirror lists are empty, not nil
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-05 20:33:28 -05:00
Jack Nagel 8ed666ae7d tests: clean up whitespace
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel 3e2c41c7d9 Demonstrate that bottles are selected correctly
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel f3dc89c1ed Prune some requires from test files
testing_env already requires utils; set up the ARGV and ENV extensions
there as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel 0c18ffd7fa Refactor checksumming
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:33 -05:00
Jack Nagel cb94753b88 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Jack Nagel 2289f98003 tests: reorganize compiler selection tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-14 15:27:45 -05:00
Jack Nagel cce350691c tests: fix no-op fails_with test
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-09 17:45:35 -05:00
Jack Nagel 21075711b7 tests: silence mirror test
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-06 22:06:05 -05:00
Jack Nagel 9d121d7ee4 Fix protection against overriding Formula#brew
The test for this previously passed, but only because the constructor
for SoftwareSpecification was raising an exception. method_added needs
to be a class method because methods are being defined on the class, not
the object, and to test it properly we have to eval the class in the
test itself.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-06 17:32:43 -05:00
Jack Nagel dae8631c4f Reset compiler when testing fails_with
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-01 14:56:04 -05:00
Jack Nagel b36f59dd3c New fails_with infrastructure
- Formulae can now declare failures on any compiler.
 - FailsWithLLVM and associated formula elements have been moved to
   compat.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-01 12:39:59 -05:00
Charlie Sharpsteen b44c76cad0 mirror support: Add test 2011-09-19 09:25:02 -07:00
Max Howell 9afc85ad33 Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00
Adam Vandenberg 2926d9a8b2 Split out some Formula tests. 2010-04-06 08:27:12 -07:00