Skip to content

Commit 717f68e

Browse files
authored
Merge pull request #2292 from MikeMcQuaid/fix-shallow-clone-tests
test: fix tests with a shallow clone.
2 parents aa866c1 + 0e30d34 commit 717f68e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Library/Homebrew/test/cmd/config_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe "brew config", :integration_test do
22
it "prints information about the current Homebrew configuration" do
33
expect { brew "config" }
4-
.to output(/HOMEBREW_VERSION: #{HOMEBREW_VERSION}/).to_stdout
4+
.to output(/HOMEBREW_VERSION: #{Regexp.escape HOMEBREW_VERSION}/).to_stdout
55
.and not_to_output.to_stderr
66
.and be_a_success
77
end

Library/Homebrew/test/tab_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
subject {
2020
described_class.new(
21-
"homebrew_version" => HOMEBREW_VERSION,
21+
"homebrew_version" => HOMEBREW_VERSION,
2222
"used_options" => used_options.as_flags,
2323
"unused_options" => unused_options.as_flags,
2424
"built_as_bottle" => false,
@@ -51,6 +51,9 @@
5151
let(:f_tab_content) { (TEST_FIXTURE_DIR/"receipt.json").read }
5252

5353
specify "defaults" do
54+
# < 1.1.7 runtime_dependencies were wrong so are ignored
55+
stub_const("HOMEBREW_VERSION", "1.1.7")
56+
5457
tab = described_class.empty
5558

5659
expect(tab.homebrew_version).to eq(HOMEBREW_VERSION)
@@ -199,6 +202,9 @@
199202

200203
describe "::create" do
201204
it "creates a Tab" do
205+
# < 1.1.7 runtime dependencies were wrong so are ignored
206+
stub_const("HOMEBREW_VERSION", "1.1.7")
207+
202208
f = formula do
203209
url "foo-1.0"
204210
depends_on "bar"
@@ -223,8 +229,8 @@
223229
{ "full_name" => "bar", "version" => "2.0" },
224230
{ "full_name" => "user/repo/from_tap", "version" => "1.0" },
225231
]
226-
227232
expect(tab.runtime_dependencies).to eq(runtime_dependencies)
233+
228234
expect(tab.source["path"]).to eq(f.path.to_s)
229235
end
230236

0 commit comments

Comments
 (0)