aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_requirement.rb
AgeCommit message (Collapse)Author
2016-09-17rubocop --auto-correct all hash-rocket usage.Mike McQuaid
2015-12-15Allow multiple option_names in dep/reqs.Mike McQuaid
This means that dependencies can be merged but still maintain all their option names. Closes Homebrew/homebrew#46916. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15Add option_name tests.Mike McQuaid
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-11-12Fix Requirement equalityJack Nagel
2014-07-07Eliminate some indirection in evaluating requirement env blocksJack Nagel
2014-07-03Add assert_eql to provide better failure messages for eql? testsJack Nagel
2014-06-18Use assert_predicateJack Nagel
2014-06-18Switch to MinitestJack Nagel
2014-06-18Use a custom test class so we can avoid monkeypatchingJack Nagel
2014-06-12Remove a const_defined? checkJack Nagel
2013-08-19Use ENV.append_pathJack Nagel
2013-08-19No longer call ENV.userpaths! in requirementsJack Nagel
Instead we use which with a custom PATH.
2013-06-27Fix some #eql? correctness issuesJack Nagel
The implementation of #eql? and #hash should ensure that if a.eql?(b), then a.hash == b.hash, but #eql? itself should not *depend* on #hash. For example, given class Thingy def eql? instance_of?(other.class) && hash == other.hash end def hash [name, *tags].hash end end if #hash produces a collision for different values of [name, *tags], two Thingy objects will appear to be eql?, even though this is not the case. Instead, #eql? should depend on the equality of name and tags directly.
2013-06-24Requirement: callers are responsible for invoking #satisfied?Jack Nagel
This hack was necessary since requirements were not checked again in the forked build process, but now they are, and calling it again after the build environment has been set up can produce incorrect results. In fact, if it happens to return false the second time, the env modification will be skipped altogether.
2013-06-03Allow explicit conversion of requirements to depsJack Nagel
Fixes Homebrew/homebrew#19857.
2013-05-06Reduce allocations in dependency constructionJack Nagel
By always passing around a single, unnested array rather than splatting and then defensively flattening and compacting things, we can avoid allocating a bunch of unnecessary arrays. This gives a performance boost of roughly 4% when enumerating 2500 formulae, and has the side effect of cleaning up the dependency API.
2013-02-12Establish a convention for Requirement namesJack Nagel
The name attribute of requirements is used when generating options for the :optional and :recommended dependency tags. Unless otherwise specified, the name attribute of a Requirement will be populated by stripping any module prefixes from the beginning and "Dependency" or "Requirement" from end of the class name and downcasing the result. Closes Homebrew/homebrew#17759.
2013-01-26Split dependency classes into separate filesJack Nagel
2013-01-26Tag Xcode and CLT requirements as build-timeJack Nagel
This way they can be skipped when installing bottles.
2013-01-22Infer path to be added for requirements that search PATHJack Nagel
When a requirement is specified like: satisfy { which "foo" } There is no reason that we should inject all of ENV.userpaths! into the build environment. Instead, infer the directory to be added to PATH from the Pathname that is returned. This is another step towards condensing the "which program" requirements down into a one-liner DSL element.
2013-01-22requirements: enable userpaths by default during evaluationJack Nagel
2013-01-21Allow satisfied? to be specified in a blockJack Nagel
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-21Allow env DSL to take a blockJack Nagel
In addition to env :userpaths env :std requirements can now do env do append 'PATH', '/some/path/to/bin' # and more end
2013-01-15Tests for Requirement DSLJack Nagel
2013-01-13Split up dependency test coverageJack Nagel
The DependencyCollector tests are really integration tests, while the rest are closer to real unit tests. Split them up so that the tests can be run in isolation on a per-class basis.