15 Commits

Author SHA1 Message Date
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
eed8af9b80 Drop unnecessary parens in tests 2014-08-13 17:14:55 -05:00
Jack Nagel
7ee49db51e Remove proc handling from BuildEnvironment 2014-07-07 22:02:32 -05:00
Jack Nagel
9822faa56a Simplify BuildEnvironmentDSL test setup 2014-07-07 21:00:38 -05:00
Jack Nagel
6664ec23dc Merge should return self 2014-07-07 20:03:41 -05:00
Jack Nagel
48c14ee736 Fix BuildEnvironment marshalling test 2014-07-07 17:48:01 -05:00
Jack Nagel
0f54f7f072 Don't need mocks here 2014-07-07 17:36:20 -05:00
Jack Nagel
879ec96743 Only store one proc per BuildEnvironment instance 2014-07-07 17:36:20 -05:00
Jack Nagel
58a75b0f71 Use assert_predicate 2014-06-18 20:34:09 -05:00
Jack Nagel
982e9239b8 Use a custom test class so we can avoid monkeypatching 2014-06-18 20:32:51 -05:00
Jack Nagel
1b0f0824fe Requirement: env DSL is evaluated in context of self, not ENV
This was meant to support:

  env do |req|
    append_path 'PATH', req.some_method
    ...
  end

i.e., the block was evaluated in the context of ENV. But it turned out
to be not so useful after all, so I'm ripping it out before something
actually depends on it.
2013-04-01 16:17:35 -05:00
Jack Nagel
aca48deda0 BuildEnvironment: use separate sets for procs and symbols 2013-02-25 14:01:02 -06:00
Jack Nagel
2503cedf2c Object#instance_exec for Ruby 1.8.6
Not thread safe! But I don't think we care.

We want to evaluate the env DSL block in the context of ENV for asthetic
reasons, but we also want access to methods on the requirement instance.
We can use #instance_exec to pass the requirement itself into the block:

  class Foo < Requirement
    env do |req|
      append 'PATH', req.some_path
    end

    def some_path
      which 'something'
    end
  end

Also add a simplified version of Object#instance_exec for Ruby 1.8.6.
2013-01-21 17:24:11 -06:00
Jack Nagel
c53af42117 Allow env DSL to take a block
In addition to

  env :userpaths
  env :std

requirements can now do

  env do
    append 'PATH', '/some/path/to/bin'
    # and more
  end
2013-01-21 17:24:10 -06:00
Jack Nagel
175820af69 Tests for BuildEnvironment 2013-01-15 18:55:10 -06:00