diff options
| author | Jack Nagel | 2013-09-21 19:27:24 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-21 19:27:24 -0500 |
| commit | 5511a8b3f528445a79ae04138698e43620400640 (patch) | |
| tree | 8fa58b85fb1f6d9d0c068cee763e1aa2fb945b9b /Library/Homebrew/test | |
| parent | a8d3aca169c7d6d83790ff52eb5cd973b54446e7 (diff) | |
| download | brew-5511a8b3f528445a79ae04138698e43620400640.tar.bz2 | |
Move dependencies to SoftwareSpec
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_formula.rb | 21 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_software_spec.rb | 18 |
2 files changed, 18 insertions, 21 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 037a8f9be..1591b425b 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -208,25 +208,4 @@ class FormulaTests < Test::Unit::TestCase ensure path.unlink end - - def test_dependency_option_integration - f = formula do - url 'foo-1.0' - depends_on 'foo' => :optional - depends_on 'bar' => :recommended - end - - assert f.build.has_option?('with-foo') - assert f.build.has_option?('without-bar') - end - - def test_explicit_options_override_default_dep_option_description - f = formula do - url 'foo-1.0' - option 'with-foo', 'blah' - depends_on 'foo' => :optional - end - - assert_equal 'blah', f.build.first.description - end end diff --git a/Library/Homebrew/test/test_software_spec.rb b/Library/Homebrew/test/test_software_spec.rb index c534cd008..66ac7feb6 100644 --- a/Library/Homebrew/test/test_software_spec.rb +++ b/Library/Homebrew/test/test_software_spec.rb @@ -47,6 +47,24 @@ class SoftwareSpecTests < Test::Unit::TestCase @spec.option(:foo) assert @spec.build.has_option? 'foo' end + + def test_depends_on + @spec.depends_on('foo') + assert_equal 'foo', @spec.deps.first.name + end + + def test_dependency_option_integration + @spec.depends_on 'foo' => :optional + @spec.depends_on 'bar' => :recommended + assert @spec.build.has_option?('with-foo') + assert @spec.build.has_option?('without-bar') + end + + def test_explicit_options_override_default_dep_option_description + @spec.option('with-foo', 'blah') + @spec.depends_on('foo' => :optional) + assert_equal 'blah', @spec.build.first.description + end end class HeadSoftwareSpecTests < Test::Unit::TestCase |
