Skip to content
Snippets Groups Projects
Commit 31b90465 authored by Markus Reiter's avatar Markus Reiter
Browse files

Use shorter `before` syntax to skip tests.

parent cf85f757
No related branches found
No related tags found
No related merge requests found
......@@ -31,22 +31,23 @@ TEST_DIRECTORIES = [
RSpec.configure do |config|
config.order = :random
config.include(Test::Helper::Shutup)
config.include(Test::Helper::Fixtures)
config.include(Test::Helper::Formula)
config.before(:each) do |example|
if example.metadata[:needs_macos]
skip "Not on macOS." unless OS.mac?
end
if example.metadata[:needs_official_cmd_taps]
skip "Needs official command Taps." unless ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"]
end
config.before(:each, :needs_official_cmd_taps) do
skip "Needs official command Taps." unless ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"]
end
if example.metadata[:needs_python]
skip "Python not installed." unless which("python")
end
config.before(:each, :needs_macos) do
skip "Not on macOS." unless OS.mac?
end
config.before(:each, :needs_python) do
skip "Python not installed." unless which("python")
end
config.around(:each) do |example|
begin
TEST_DIRECTORIES.each(&:mkpath)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment