diff options
| author | Jack Nagel | 2013-01-23 00:26:24 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-26 11:37:02 -0600 |
| commit | e2c4a0523581e6ffe576f0e163a5fdad4d7cbba7 (patch) | |
| tree | f4a848a456fca28bfbaf517edb9a498f70d400bf /Library | |
| parent | 5088fdd54324b9ab053794909aab05fa2d81454b (diff) | |
| download | brew-e2c4a0523581e6ffe576f0e163a5fdad4d7cbba7.tar.bz2 | |
Tests for BuildOptions
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/test_build_options.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb new file mode 100644 index 000000000..c0ed28d1e --- /dev/null +++ b/Library/Homebrew/test/test_build_options.rb @@ -0,0 +1,38 @@ +require 'testing_env' +require 'build_options' + +class BuildOptionsTests < Test::Unit::TestCase + def setup + args = %w{--with-foo --with-bar --without-qux}.extend(HomebrewArgvExtension) + @build = BuildOptions.new(args) + @build.add("with-foo") + @build.add("with-bar") + @build.add("without-baz") + @build.add("without-qux") + end + + def test_as_flags + assert_equal %w{--with-foo --with-bar --without-baz --without-qux}.sort, + @build.as_flags.sort + end + + def test_has_option? + assert @build.has_option?("with-foo") + assert !@build.has_option?("with-qux") + end + + def test_include + assert @build.include?("with-foo") + assert !@build.include?("with-qux") + assert !@build.include?("--with-foo") + end + + def test_used_options + assert @build.used_options.include?("--with-foo") + assert @build.used_options.include?("--with-bar") + end + + def test_unused_options + assert @build.unused_options.include?("--without-baz") + end +end |
