diagnostic: share prefix check
This commit is contained in:
parent
406272f007
commit
0d0eac8078
@ -791,6 +791,17 @@ module Homebrew
|
|||||||
end.join("\n")
|
end.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_homebrew_prefix
|
||||||
|
return if HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX
|
||||||
|
|
||||||
|
<<~EOS
|
||||||
|
Your Homebrew's prefix is not #{Homebrew::DEFAULT_PREFIX}.
|
||||||
|
You can install Homebrew anywhere you want but some bottles (binary packages)
|
||||||
|
can only be used with a standard prefix and some formulae (packages)
|
||||||
|
may not build correctly with a non-standard prefix.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
def all
|
def all
|
||||||
methods.map(&:to_s).grep(/^check_/)
|
methods.map(&:to_s).grep(/^check_/)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -284,17 +284,6 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_homebrew_prefix
|
|
||||||
return if HOMEBREW_PREFIX.to_s == "/usr/local"
|
|
||||||
|
|
||||||
<<~EOS
|
|
||||||
Your Homebrew's prefix is not /usr/local.
|
|
||||||
You can install Homebrew anywhere you want but some bottles (binary packages)
|
|
||||||
can only be used with a /usr/local prefix and some formulae (packages)
|
|
||||||
may not build correctly with a non-/usr/local prefix.
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_for_gettext
|
def check_for_gettext
|
||||||
find_relative_paths("lib/libgettextlib.dylib",
|
find_relative_paths("lib/libgettextlib.dylib",
|
||||||
"lib/libintl.dylib",
|
"lib/libintl.dylib",
|
||||||
|
|||||||
@ -162,4 +162,10 @@ describe Homebrew::Diagnostic::Checks do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
specify "#check_homebrew_prefix" do
|
||||||
|
# the integration tests are run in a special prefix
|
||||||
|
expect(subject.check_homebrew_prefix)
|
||||||
|
.to match("Your Homebrew's prefix is not #{Homebrew::DEFAULT_PREFIX}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -32,12 +32,6 @@ describe Homebrew::Diagnostic::Checks do
|
|||||||
.to match("Xcode alone is not sufficient on El Capitan")
|
.to match("Xcode alone is not sufficient on El Capitan")
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "#check_homebrew_prefix" do
|
|
||||||
# the integration tests are run in a special prefix
|
|
||||||
expect(subject.check_homebrew_prefix)
|
|
||||||
.to match("Your Homebrew's prefix is not /usr/local.")
|
|
||||||
end
|
|
||||||
|
|
||||||
specify "#check_ruby_version" do
|
specify "#check_ruby_version" do
|
||||||
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.12"))
|
allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.12"))
|
||||||
stub_const("RUBY_VERSION", "1.8.6")
|
stub_const("RUBY_VERSION", "1.8.6")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user