3049 Commits

Author SHA1 Message Date
Jack Nagel
25c0ecfd63 Add tests for formula spec selection
These tests document the relative precedence of the stable, bottle,
devel, and head specifications, and the conditions that can influence
which is selected (e.g. command-line flags).
2013-04-13 17:40:13 -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
Jack Nagel
291977d823 Run tap --repair as part of prune
And by extension, `cleanup`.

Fixes Homebrew/homebrew#18658.
2013-04-13 17:23:14 -05:00
Jack Nagel
eb16d746d7 Clean up checksum verification tests 2013-04-13 16:36:30 -05:00
Jack Nagel
7f9bd7a067 doctor: 'raring' => 'ready'
It was pointed out that 'raring' is a rare word can be confusing to
non-native speakers.

Closes Homebrew/homebrew#18659, see that for details.
2013-04-12 19:32:23 -05:00
Jack Nagel
d25767b354 doctor: consolidate directory access checks
Also include a writability check for lib.

Closes Homebrew/homebrew#18571.
2013-04-12 19:32:02 -05:00
Jiang Xin
f30200890e versions: work for tapped formulae
brew versions is hardcoded to cd to HOMEBREW_REPOSITORY before running
git, and as such fails to report previous versions for any formulae
from a tapped repository.

Add two new private methods repository and entry_name to replace the
hardcoded HOMEBREW_REPOSITORY and formula path, and brew versions
work for both builtin and tapped formulae.

Closes Homebrew/homebrew#12356.
Closes Homebrew/homebrew#19069.

Reported-by: Misty De Meo <mistydemeo@gmail.com>
Suggested-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-11 23:45:15 -05:00
Geoff Petrie
79c745cc76 doctor: suggest brew update in outdated warning
Closes Homebrew/homebrew#19106.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-11 02:12:59 -05:00
Jack Nagel
909ac74644 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
d526d2b257 More comprehensive tests for Pathname extension 2013-04-10 20:05:43 -05:00
Jack Nagel
951b09b1c5 link: eliminate naked rescue 2013-04-10 12:02:35 -05:00
Jack Nagel
47282db255 Make test formulae initializers more flexible 2013-04-10 12:02:35 -05:00
Jack Nagel
eadb0f60a8 Move formula equality tests out of test_bucket 2013-04-10 12:02:35 -05:00
Jack Nagel
136aa4c6f4 Remove last use of deprecated Formula#recursive_deps
Fixes Homebrew/homebrew#19107.
2013-04-10 11:55:02 -05:00
Jack Nagel
bd4aaac96b Check existence rather than rescue exceptions 2013-04-09 19:40:08 -05:00
Jack Nagel
67844c9012 Simplify these tests 2013-04-09 19:40:08 -05:00
Jack Nagel
6ed441bd71 SubversionDownloadStrategy: *really* fix pathname concatenation 2013-04-08 23:07:21 -05:00
Jack Nagel
b681ed4200 SubversionDownloadStrategy: fix pathname concatenation
Fixes Homebrew/homebrew#19066.
2013-04-08 19:18:19 -05:00
Jack Nagel
63aace0e4e Clean up mirror support test 2013-04-08 19:15:22 -05:00
Jack Nagel
646102c311 Fix argument order in test_comparableset 2013-04-08 18:34:55 -05:00
Jack Nagel
d07defa7c1 Fix specs in TestBall 2013-04-08 17:43:01 -05:00
Jack Nagel
a90259b690 Tests for SoftwareSpec and subclasses 2013-04-08 00:55:44 -05:00
Jack Nagel
ef0e4c259f Ensure ARGV is cleaned up 2013-04-08 00:27:47 -05:00
Jack Nagel
9dda9339ad Remove dead code
This is initialized in #initialize.
2013-04-08 00:27:47 -05:00
Jack Nagel
0497afbe57 Clean up some things in test_bucket 2013-04-07 20:59:52 -05:00
Jack Nagel
c816ad70b6 Simplify tests 2013-04-07 20:59:52 -05:00
Jack Nagel
9013b3a0c9 Define RUBY_PATH for tests 2013-04-07 20:59:52 -05:00
Jack Nagel
34bcb10b54 test_patching: inline test classes 2013-04-07 20:59:51 -05:00
Jack Nagel
bafbd07c9e Isolate ARGV extension tests 2013-04-07 20:59:51 -05:00
Jack Nagel
a79b7d6e0f Delete pointless test 2013-04-07 20:59:51 -05:00
Jack Nagel
8cf0f34aa7 Download strategies require a usable name
We should handle this case in some predictable way, but until we do,
let's raise a more appropriate exception. It would also be good to get
rid of the duplication here.
2013-04-07 20:59:50 -05:00
Jack Nagel
2288f63197 Tests for AbstractDownloadStrategy 2013-04-07 20:59:50 -05:00
Jack Nagel
9db0e68eb6 Unify indentation of access modifiers
These are class method calls, not some special keyword, and should be
indented as such (also all standard Ruby indenters do this).
2013-04-07 20:59:49 -05:00
Jack Nagel
349cdab76f Tests for Checksum class 2013-04-07 20:59:49 -05:00
Misty De Meo
3882603ba8 MacCPUs: add .avx? helper 2013-04-07 12:47:56 -05:00
Jack Nagel
8bd619e03b audit: clean up some regexps 2013-04-06 22:12:21 -05:00
Jack Nagel
4a8653ba7d audit: check build-time deps programmatically 2013-04-06 22:11:02 -05:00
Jack Nagel
d6b5e4f2ed audit: rescue only FormulaUnavailableError 2013-04-06 22:10:43 -05:00
Jack Nagel
7f55a6089e audit: clean up URL audits 2013-04-06 22:10:33 -05:00
Jack Nagel
d4a8813e86 mxcl.github.com/homebrew => brew.sh 2013-04-06 15:51:03 -05:00
Jaime Marquínez Ferrándiz
254f3b2c3c brew audit: find *.github.com pages
And suggest changing them to *.github.io

Closes Homebrew/homebrew#19012.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-04-06 13:12:53 -07:00
Jack Nagel
89bb6664c4 Replace literal paths to ruby with RUBY_PATH 2013-04-06 13:10:12 -05:00
Jack Nagel
aa58a404ed Fix another handful of warnings 2013-04-06 00:14:03 -05:00
Jack Nagel
8234ac22e9 FormulaLock: fix uninitialized ivar 2013-04-05 22:07:11 -05:00
Jack Nagel
05a8c1913c FormulaInstaller: this local is an ivar now 2013-04-05 22:07:02 -05:00
Jack Nagel
6eac9679c0 FormulaInstaller: initialize @tab 2013-04-05 22:00:36 -05:00
Jack Nagel
e0d6ee863f Make some groups non-capturing 2013-04-05 22:00:36 -05:00
Jack Nagel
62a0b3f18d Use #grep where it will suffice 2013-04-05 22:00:36 -05:00
Jack Nagel
9f9608e6c5 Allow pipe fd to be inherited under Ruby 2.0 2013-04-05 17:42:53 -05:00