|
10 | 10 |
|
11 | 11 | it_behaves_like "parseable arguments" |
12 | 12 |
|
13 | | - it "installs a Formula", :integration_test do |
14 | | - setup_test_formula "testball1" |
| 13 | + it "installs a Formula from bottle", :integration_test do |
| 14 | + formula_name = "testball_bottle" |
| 15 | + formula_prefix = HOMEBREW_CELLAR/formula_name/"0.1" |
| 16 | + formula_prefix_regex = /#{Regexp.escape(formula_prefix)}/ |
| 17 | + option_file = formula_prefix/"foo/test" |
| 18 | + bottle_file = formula_prefix/"bin/helloworld" |
15 | 19 |
|
16 | | - expect { brew "install", "testball1" } |
17 | | - .to output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}o).to_stdout |
| 20 | + setup_test_formula formula_name |
| 21 | + |
| 22 | + expect { brew "install", formula_name } |
| 23 | + .to output(formula_prefix_regex).to_stdout |
18 | 24 | .and output(/✔︎.*/m).to_stderr |
19 | 25 | .and be_a_success |
20 | | - expect(testball1_rack/"0.1/foo/test").not_to be_a_file |
| 26 | + expect(option_file).not_to be_a_file |
| 27 | + expect(bottle_file).to be_a_file |
21 | 28 |
|
22 | | - uninstall_test_formula "testball1" |
| 29 | + uninstall_test_formula formula_name |
23 | 30 |
|
24 | | - expect { brew "install", "testball1", "--with-foo" } |
25 | | - .to output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}o).to_stdout |
| 31 | + expect { brew "install", "--ask", formula_name } |
| 32 | + .to output(/.*Formula\s*\(1\):\s*#{formula_name}.*/).to_stdout |
26 | 33 | .and output(/✔︎.*/m).to_stderr |
27 | 34 | .and be_a_success |
28 | | - expect(testball1_rack/"0.1/foo/test").to be_a_file |
| 35 | + expect(option_file).not_to be_a_file |
| 36 | + expect(bottle_file).to be_a_file |
29 | 37 |
|
30 | | - uninstall_test_formula "testball1" |
| 38 | + uninstall_test_formula formula_name |
31 | 39 |
|
32 | | - expect { brew "install", "testball1", "--debug-symbols", "--build-from-source" } |
33 | | - .to output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}o).to_stdout |
34 | | - .and output(/✔︎.*/m).to_stderr |
35 | | - .and be_a_success |
36 | | - expect(testball1_rack/"0.1/bin/test").to be_a_file |
37 | | - expect(testball1_rack/"0.1/bin/test.dSYM/Contents/Resources/DWARF/test").to be_a_file if OS.mac? |
38 | | - expect(HOMEBREW_CACHE/"Sources/testball1").to be_a_directory |
| 40 | + expect { brew "install", formula_name, { "HOMEBREW_FORBIDDEN_FORMULAE" => formula_name } } |
| 41 | + .to not_to_output(formula_prefix_regex).to_stdout |
| 42 | + .and output(/#{formula_name} was forbidden/).to_stderr |
| 43 | + .and be_a_failure |
| 44 | + expect(formula_prefix).not_to exist |
| 45 | + end |
| 46 | + |
| 47 | + it "installs a Formula from source", :integration_test do |
| 48 | + formula_name = "testball2" |
| 49 | + formula_prefix = HOMEBREW_CELLAR/formula_name/"0.1" |
| 50 | + formula_prefix_regex = /#{Regexp.escape(formula_prefix)}/ |
| 51 | + option_file = formula_prefix/"foo/test" |
| 52 | + always_built_file = formula_prefix/"bin/test" |
39 | 53 |
|
40 | | - uninstall_test_formula "testball1" |
| 54 | + setup_test_formula formula_name |
41 | 55 |
|
42 | | - expect { brew "install", "--ask", "testball1" } |
43 | | - .to output(/.*Formula\s*\(1\):\s*testball1.*/).to_stdout |
| 56 | + expect { brew "install", formula_name, "--with-foo" } |
| 57 | + .to output(formula_prefix_regex).to_stdout |
44 | 58 | .and output(/✔︎.*/m).to_stderr |
45 | 59 | .and be_a_success |
46 | | - expect(testball1_rack/"0.1/bin/test").to be_a_file |
| 60 | + expect(option_file).to be_a_file |
| 61 | + expect(always_built_file).to be_a_file |
47 | 62 |
|
48 | | - uninstall_test_formula "testball1" |
| 63 | + uninstall_test_formula formula_name |
49 | 64 |
|
50 | | - expect { brew "install", "testball1", { "HOMEBREW_FORBIDDEN_FORMULAE" => "testball1" } } |
51 | | - .to not_to_output(%r{#{HOMEBREW_CELLAR}/testball1/0\.1}o).to_stdout |
52 | | - .and output(/testball1 was forbidden/).to_stderr |
53 | | - .and be_a_failure |
54 | | - expect(testball1_rack).not_to exist |
| 65 | + expect { brew "install", formula_name, "--debug-symbols", "--build-from-source" } |
| 66 | + .to output(formula_prefix_regex).to_stdout |
| 67 | + .and output(/✔︎.*/m).to_stderr |
| 68 | + .and be_a_success |
| 69 | + expect(option_file).not_to be_a_file |
| 70 | + expect(always_built_file).to be_a_file |
| 71 | + expect(formula_prefix/"bin/test.dSYM/Contents/Resources/DWARF/test").to be_a_file if OS.mac? |
| 72 | + expect(HOMEBREW_CACHE/"Sources/#{formula_name}").to be_a_directory |
55 | 73 | end |
56 | 74 |
|
57 | 75 | it "installs a keg-only Formula", :integration_test do |
|
0 commit comments