6354 Commits

Author SHA1 Message Date
Jack Nagel
59981c5b4c Move a test class that is only used once into the test 2014-06-12 17:58:12 -05:00
Jack Nagel
a50f09c343 Remove an extra slash in file:// URLs in tests 2014-06-12 17:58:12 -05:00
Jack Nagel
9a554f5f4b Use example.com as domain in tests 2014-06-12 17:58:12 -05:00
Jack Nagel
4f476d7066 Remove dummy method 2014-06-12 17:58:12 -05:00
Jack Nagel
502078099f Prefer self.class.name to self.class.to_s 2014-06-12 16:13:07 -05:00
Jack Nagel
4651b5214f Remove a const_defined? check 2014-06-12 16:09:03 -05:00
Shaun Jackman
ae3e567daa Linuxbrew: Use xdg-open
Closes Homebrew/homebrew#29817.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-12 13:11:05 -05:00
Jack Nagel
96195295a3 Deprecate Pathname#cp and Pathname#chmod_R
As far as I can tell these methods have only ever been used in the test
suite.

Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.

Closes Homebrew/homebrew#30081.
2014-06-12 09:00:58 -05:00
Jack Nagel
faaa622820 Deprecate Pathname#/ with non-string/non-pathname arguments
Ruby 2.2 will define Pathname#/ as a simple alias of Pathname#+.
In practice, this means that it will raise a TypeError unless the
argument responds to to_path or to_str.

Currently we blindly convert the argument to a string using to_s, so
deprecate this in the interest of matching the upstream behavior. In the
future we can replace this with

  alias_method :/, :+ unless method_defined?(:/)

Closes Homebrew/homebrew#30079.
2014-06-12 09:00:51 -05:00
Jack Nagel
6eb7e0c27f Eliminate an uninitialized ivar warning 2014-06-11 21:34:09 -05:00
Jack Nagel
c319eb1f01 Decouple CompilerSelector from MacOS, clean up tests 2014-06-11 21:23:05 -05:00
Jack Nagel
290db72bd5 Pass the version into the Compiler constructor, eliminate a type check 2014-06-11 21:21:50 -05:00
Jack Nagel
f3e9c5c070 Fix up some assertions 2014-06-11 13:05:10 -05:00
Jack Nagel
ddc615366c Use assert_empty 2014-06-11 12:22:29 -05:00
Jack Nagel
93d8e71641 Use Digest#file if it's available 2014-06-11 12:05:19 -05:00
Jack Nagel
c0e0bd2984 Read df output in binary mode
Fixes Homebrew/homebrew#30046.
2014-06-11 00:42:51 -05:00
Jack Nagel
5ec52ea4da Remove unnecessary require 2014-06-10 22:29:20 -05:00
Jack Nagel
dd1f742854 Remove unnecessary code 2014-06-10 21:50:58 -05:00
Jack Nagel
0505582507 Rename TEST_FOLDER to TEST_DIRECTORY 2014-06-10 21:49:41 -05:00
Jack Nagel
dbe82909a3 Remove ABS__FILE constant from test environment 2014-06-10 21:46:29 -05:00
Jack Nagel
9a0098dbec Scope setup to the tests that need it 2014-06-10 21:21:09 -05:00
Jack Nagel
6e634890e8 Add methods for building test file paths 2014-06-10 21:21:06 -05:00
Jack Nagel
5263f50f74 Trust the fixtures and stop asserting on file(1) output 2014-06-10 20:40:51 -05:00
Jack Nagel
e3472540c1 Pull common code into setup method 2014-06-10 20:40:51 -05:00
Jack Nagel
c7685d2b70 Extract constant strings 2014-06-10 20:24:07 -05:00
Jack Nagel
df7756aeb9 Pull mock initialization code into initialize 2014-06-10 20:04:51 -05:00
Jack Nagel
65673d60c1 Move updater mock into test class namespace 2014-06-10 20:03:37 -05:00
Jack Nagel
d8f86f290b Use external interface in tests 2014-06-10 19:56:42 -05:00
Jack Nagel
cd4b801749 Simplify test setup 2014-06-10 19:44:46 -05:00
Jack Nagel
ba856de06e Remove rcov rake task
rcov is not compatible with Ruby 2.0.
2014-06-10 17:50:33 -05:00
Jack Nagel
b7a0602f72 Remove ruby-prof rake task
The areas that we are interested in optimizing for performance are
things that are invoked repeatedly, and are not evident in the test
suite.
2014-06-10 17:50:33 -05:00
Jack Nagel
191e588212 Stop caching Superenv.bin
It is not a hotspot and causes an ordering dependency in the tests.
2014-06-10 17:50:33 -05:00
Jack Nagel
801cdd9045 Remove default values from formula constructor parameters
Closes Homebrew/homebrew#30017.
2014-06-10 15:41:45 -05:00
Jack Nagel
84cd9cc28f "exit $?" raises TypeError on Ruby 2.0 2014-06-10 11:33:17 -05:00
Jack Nagel
7f10aa3b6e Fix visibility of FileUtils extension methods 2014-06-09 21:37:52 -05:00
Jack Nagel
9e57da83a2 Stop exposing mktemp as a public method on formula objects 2014-06-09 21:36:36 -05:00
Jack Nagel
83f2ee5aea Use RbConfig.ruby if it's available 2014-06-09 21:36:36 -05:00
Jack Nagel
fdcbc5e4db Only do formula class sanity checks once 2014-06-09 19:55:31 -05:00
Jack Nagel
14aa1de33c Fix warning under Ruby 2.2 2014-06-09 15:04:15 -05:00
Jack Nagel
e3f082c294 Stop joining symbols to pathnames
Ruby 2.2's native Pathname#/ accepts only string-like objects.
2014-06-09 14:57:21 -05:00
Jack Nagel
974b7e71ef Use opt shortcut methods 2014-06-09 14:57:21 -05:00
Jack Nagel
13355c76ac Fix formula test helper parameters 2014-06-09 14:46:30 -05:00
Jack Nagel
fb3f95923b Just access the ivar directly 2014-06-08 20:04:16 -05:00
Jack Nagel
d27dc1d02f Work around encoding issue in Pathname#inspect on Ruby 2.0
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's
underlying string and returns a string tagged as ASCII-8BIT.

If you simply write

  puts Pathname.new("some string with non-ascii bytes").inspect

no error will be raised, because the implementation of Pathname#inspect
does not call into Object#inspect.

However, if you wrap that pathname object in an array first, then

  puts [Pathname.new("some string with non-ascii bytes")].inspect

will raise Encoding::CompatibilityError: "inspected result must be ASCII
only or use the same encoding with default external".

Raising an error in this codepath is new in Ruby 2.0, and this specific
bug is fixed in Ruby 2.1. I've opened a bug upstream:
  https://bugs.ruby-lang.org/issues/9915

Fixes Homebrew/homebrew#29947.
2014-06-08 20:00:52 -05:00
Jack Nagel
6d0f0cb195 metafiles: simplify #copy? further 2014-06-07 23:40:28 -05:00
Jack Nagel
07257f2f48 Simplify Pathname#install_metafiles 2014-06-07 21:15:56 -05:00
Jack Nagel
fcacb25cd5 Eliminate FORMULA_META_FILES constant 2014-06-07 21:15:56 -05:00
Jack Nagel
fef866aae4 metafiles: combine #should_copy? and #include? 2014-06-07 21:15:55 -05:00
Jack Nagel
3aa75f5e18 metafiles: remove unused method 2014-06-07 21:15:55 -05:00
Jack Nagel
e2c79aaea4 metafiles: extract constant arrays 2014-06-07 21:15:54 -05:00