Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/unpack_strategy: Handle svn unzip unavailable #4671

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Library/Homebrew/test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@
end

config.before(:each, :needs_svn) do
skip "Requires subversion." unless which "svn"
skip "subversion not installed." unless which "svn"
end

config.before(:each, :needs_unzip) do
skip "unzip not installed." unless which("unzip")
end

config.around(:each) do |example|
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/unpack_strategy/jar_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative "shared_examples"

describe UnpackStrategy::Jar do
describe UnpackStrategy::Jar, :needs_unzip do
let(:path) { TEST_FIXTURE_DIR/"test.jar" }

include_examples "UnpackStrategy::detect"
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/unpack_strategy/subversion_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative "shared_examples"

describe UnpackStrategy::Subversion do
describe UnpackStrategy::Subversion, :needs_svn do
let(:repo) { mktmpdir }
let(:working_copy) { mktmpdir }
let(:path) { working_copy }
Expand Down
5 changes: 4 additions & 1 deletion Library/Homebrew/test/unpack_strategy/zip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
let(:path) { TEST_FIXTURE_DIR/"cask/MyFancyApp.zip" }

include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["MyFancyApp"]

context "when unzip is available", :needs_unzip do
include_examples "#extract", children: ["MyFancyApp"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does adding :needs_unzip to this line work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

end

context "when ZIP archive is corrupted" do
let(:path) {
Expand Down