Commit Graph
31 Commits
Author SHA1 Message Date
Jack Nagel 55a122ea0c Run tests under actual OS version 2013-06-14 19:19:26 -05:00
Jack Nagel 2bba5c3f07 Check method existence rather than Ruby version 2013-06-11 17:05:44 -05:00
Jack Nagel a41d7942a0 Add Enumerable#group_by 2013-06-08 12:23:14 -05:00
Jack Nagel 0759cce3c2 Extract attr_rw from Formula for reuse
Closes #20239.
2013-06-04 11:06:18 -05:00
Jack Nagel ae57857ac5 tests: extract common formula helper 2013-05-25 17:19:18 -05:00
Jack Nagel 366ac016bd Reorganize compat 2013-05-10 23:27:28 -05:00
Jack Nagel ad8c9c2683 Define RUBY_PATH for tests 2013-04-07 20:59:52 -05:00
Jack Nagel 6731611a79 Make testing_env somewhat readable 2013-04-01 15:53:42 -05:00
Jack Nagel cf2c7cf5cc tests: allow setting MACOS_VERSION from the environment
This makes it easy to test things that vary depending on this constant
without editing testing_env.rb.
2013-03-09 17:38:49 -06:00
Jack Nagel b48e89cbb2 Allow satisfied? to be specified in a block
Instead of overriding #satisfied?, Requirement subclasses can specify
the condition in a block:

  satisfy do
    some_condition?
  end

The contents of the block are evaluated in the context of the instance,
and so have access to instance variables and instance methods as before.
Additionally, it is wrapped in an ENV.with_build_environment block. This
can be disabled by passing :build_env => false to satisfy:

  satisfy :build_env => false do
    some_condition?
  end
2013-01-21 17:24:12 -06:00
Jack Nagel 483ac48734 tests: add mocha mocking library 2013-01-21 17:14:16 -06:00
Jack Nagel 296c31b717 Define HOMEBREW_LIBRARY for tests 2013-01-12 17:51:29 -06:00
Jack Nagel fbfc30fe1c tests: define assert_empty for Ruby <= 1.8
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 22:09:23 -05: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 d02c001f96 Make FileUtils extension available globally
Now that we are monkeypatching copy_metadata, we should load our
extension up front for consistency.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-27 16:22:01 -05:00
Jack Nagel 4197a4872d tests: avoid unnecessary chdir
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-30 00:10:02 -05:00
Jack Nagel 6f1c1b96f7 tests: support "rake rcov" if rcov is installed
If the rcov gem is installed, `rake rcov` will generate a test coverage
report in the coverage directory.

I picked rcov because it is 1.8 compatible. But it could easily be
swapped out for another coverage tool.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-29 15:56:36 -05:00
Jack Nagel 74c58497bd Simplify version comparison tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:03:43 -05:00
Jack Nagel 4affbabfb7 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel dc4c40b90c tests: require string extension before exceptions
exceptions.rb now needs String#undent when it is loaded.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-12 01:02:37 -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 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 cb94753b88 Introduce new formula specs 2012-07-04 22:47:32 -05:00
Jack Nagel aa885cf4e7 tests: add utility method to quell output
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-18 15:16:00 -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
Max Howell 35391a309c HOMEBREW_CURL_ARGS so that tests can be more silent 2011-08-24 22:30:43 +01: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 8deec24d87 Move exceptions from global to utils; remove duplicate defintions 2010-07-08 22:41:51 -07:00
Adam Vandenberg a05a0d85ad Fix: attr doesn't take a list. 2010-06-10 19:39:15 -07:00
Adam Vandenberg 7a12e2c398 Failures during ./configure should mention config.log. 2010-06-10 12:57:51 -07:00
Adam Vandenberg 8c448ca360 Add new "testing environment" include. 2010-04-06 08:27:10 -07:00