Cleanup Requirements
- remove unused NonBinaryOsxfuseRequirement - import CodeSignRequirement from Homebrew/homebrew-core - remove unused UnsignedKextRequirement - don’t allow custom name for X11Requirement
This commit is contained in:
		
							parent
							
								
									1f08739de0
								
							
						
					
					
						commit
						0c0275771d
					
				@ -1,4 +1,6 @@
 | 
				
			|||||||
require "compat/os/mac"
 | 
					require "compat/os/mac"
 | 
				
			||||||
 | 
					require "compat/requirements/x11_requirement"
 | 
				
			||||||
 | 
					require "compat/requirements/xcode_requirement"
 | 
				
			||||||
require "compat/dependable"
 | 
					require "compat/dependable"
 | 
				
			||||||
require "compat/dependency_collector"
 | 
					require "compat/dependency_collector"
 | 
				
			||||||
require "compat/fileutils"
 | 
					require "compat/fileutils"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										17
									
								
								Library/Homebrew/compat/requirements/x11_requirement.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Library/Homebrew/compat/requirements/x11_requirement.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					require "requirement"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class X11Requirement < Requirement
 | 
				
			||||||
 | 
					  module Compat
 | 
				
			||||||
 | 
					    def initialize(tags = [])
 | 
				
			||||||
 | 
					      if tags.first.to_s.match?(/(\d\.)+\d/)
 | 
				
			||||||
 | 
					        # TODO: deprecate when Homebrew/homebrew-core is fixed.
 | 
				
			||||||
 | 
					        # odeprecated('depends_on :x11 => "X.Y.Z"')
 | 
				
			||||||
 | 
					        tags.shift
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      super(tags)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  prepend Compat
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										22
									
								
								Library/Homebrew/compat/requirements/xcode_requirement.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								Library/Homebrew/compat/requirements/xcode_requirement.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					require "requirement"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class XcodeRequirement < Requirement
 | 
				
			||||||
 | 
					  module Compat
 | 
				
			||||||
 | 
					    def initialize(tags = [])
 | 
				
			||||||
 | 
					      @version = if tags.first.to_s.match?(/(\d\.)+\d/)
 | 
				
			||||||
 | 
					        tags.shift
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        tags.find do |tag|
 | 
				
			||||||
 | 
					          next unless tag.to_s.match?(/(\d\.)+\d/)
 | 
				
			||||||
 | 
					          # TODO: deprecate when Homebrew/homebrew-core is fixed.
 | 
				
			||||||
 | 
					          # odeprecated('depends_on :xcode => [..., "X.Y.Z"]')
 | 
				
			||||||
 | 
					          tags.delete(tag)
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      super(tags)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  prepend Compat
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@ -116,14 +116,16 @@ class DependencyCollector
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  def parse_symbol_spec(spec, tags)
 | 
					  def parse_symbol_spec(spec, tags)
 | 
				
			||||||
    case spec
 | 
					    case spec
 | 
				
			||||||
    when :x11        then X11Requirement.new(spec.to_s, tags)
 | 
					    when :arch          then ArchRequirement.new(tags)
 | 
				
			||||||
    when :xcode      then XcodeRequirement.new(tags)
 | 
					    when :codesign      then CodesignRequirement.new(tags)
 | 
				
			||||||
 | 
					    when :java          then JavaRequirement.new(tags)
 | 
				
			||||||
    when :linux         then LinuxRequirement.new(tags)
 | 
					    when :linux         then LinuxRequirement.new(tags)
 | 
				
			||||||
    when :macos         then MacOSRequirement.new(tags)
 | 
					    when :macos         then MacOSRequirement.new(tags)
 | 
				
			||||||
    when :arch       then ArchRequirement.new(tags)
 | 
					    when :maximum_macos then MaximumMacOSRequirement.new(tags)
 | 
				
			||||||
    when :java       then JavaRequirement.new(tags)
 | 
					 | 
				
			||||||
    when :osxfuse       then OsxfuseRequirement.new(tags)
 | 
					    when :osxfuse       then OsxfuseRequirement.new(tags)
 | 
				
			||||||
    when :tuntap        then TuntapRequirement.new(tags)
 | 
					    when :tuntap        then TuntapRequirement.new(tags)
 | 
				
			||||||
 | 
					    when :x11           then X11Requirement.new(tags)
 | 
				
			||||||
 | 
					    when :xcode         then XcodeRequirement.new(tags)
 | 
				
			||||||
    when :ld64          then ld64_dep_if_needed(tags)
 | 
					    when :ld64          then ld64_dep_if_needed(tags)
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      raise ArgumentError, "Unsupported special dependency #{spec.inspect}"
 | 
					      raise ArgumentError, "Unsupported special dependency #{spec.inspect}"
 | 
				
			||||||
 | 
				
			|||||||
@ -1,15 +0,0 @@
 | 
				
			|||||||
require "requirement"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class NonBinaryOsxfuseRequirement < Requirement
 | 
					 | 
				
			||||||
  fatal true
 | 
					 | 
				
			||||||
  satisfy(build_env: false) do
 | 
					 | 
				
			||||||
    HOMEBREW_PREFIX.to_s != "/usr/local" || !OsxfuseRequirement.binary_osxfuse_installed?
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def message
 | 
					 | 
				
			||||||
    <<~EOS
 | 
					 | 
				
			||||||
      osxfuse is already installed from the binary distribution and
 | 
					 | 
				
			||||||
      conflicts with this formula.
 | 
					 | 
				
			||||||
    EOS
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
@ -1,3 +0,0 @@
 | 
				
			|||||||
if OS.mac?
 | 
					 | 
				
			||||||
  require "extend/os/mac/requirements/non_binary_osxfuse_requirement"
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
@ -1,11 +1,11 @@
 | 
				
			|||||||
require "requirement"
 | 
					require "requirement"
 | 
				
			||||||
 | 
					require "requirements/arch_requirement"
 | 
				
			||||||
 | 
					require "requirements/codesign_requirement"
 | 
				
			||||||
 | 
					require "requirements/java_requirement"
 | 
				
			||||||
require "requirements/linux_requirement"
 | 
					require "requirements/linux_requirement"
 | 
				
			||||||
require "requirements/macos_requirement"
 | 
					require "requirements/macos_requirement"
 | 
				
			||||||
require "requirements/maximum_macos_requirement"
 | 
					require "requirements/maximum_macos_requirement"
 | 
				
			||||||
require "requirements/osxfuse_requirement"
 | 
					require "requirements/osxfuse_requirement"
 | 
				
			||||||
require "requirements/java_requirement"
 | 
					 | 
				
			||||||
require "requirements/tuntap_requirement"
 | 
					require "requirements/tuntap_requirement"
 | 
				
			||||||
require "requirements/unsigned_kext_requirement"
 | 
					 | 
				
			||||||
require "requirements/x11_requirement"
 | 
					require "requirements/x11_requirement"
 | 
				
			||||||
require "requirements/arch_requirement"
 | 
					 | 
				
			||||||
require "requirements/xcode_requirement"
 | 
					require "requirements/xcode_requirement"
 | 
				
			||||||
 | 
				
			|||||||
@ -3,9 +3,9 @@ require "requirement"
 | 
				
			|||||||
class ArchRequirement < Requirement
 | 
					class ArchRequirement < Requirement
 | 
				
			||||||
  fatal true
 | 
					  fatal true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(arch)
 | 
					  def initialize(tags)
 | 
				
			||||||
    @arch = arch.pop
 | 
					    @arch = tags.shift
 | 
				
			||||||
    super
 | 
					    super(tags)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  satisfy(build_env: false) do
 | 
					  satisfy(build_env: false) do
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										32
									
								
								Library/Homebrew/requirements/codesign_requirement.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Library/Homebrew/requirements/codesign_requirement.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					class CodesignRequirement < Requirement
 | 
				
			||||||
 | 
					  fatal true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def initialize(tags)
 | 
				
			||||||
 | 
					    options = tags.shift
 | 
				
			||||||
 | 
					    unless options.is_a?(Hash)
 | 
				
			||||||
 | 
					      raise ArgumentError("CodesignRequirement requires an options Hash!")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    unless options.key?(:identity)
 | 
				
			||||||
 | 
					      raise ArgumentError("CodesignRequirement requires an identity key!")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @identity = options.fetch(:identity)
 | 
				
			||||||
 | 
					    @with = options.fetch(:with, "code signing")
 | 
				
			||||||
 | 
					    @url = options.fetch(:url, nil)
 | 
				
			||||||
 | 
					    super(tags)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  satisfy(build_env: false) do
 | 
				
			||||||
 | 
					    mktemp do
 | 
				
			||||||
 | 
					      FileUtils.cp "/usr/bin/false", "codesign_check"
 | 
				
			||||||
 | 
					      quiet_system "/usr/bin/codesign", "-f", "-s", @identity,
 | 
				
			||||||
 | 
					                                        "--dryrun", "codesign_check"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def message
 | 
				
			||||||
 | 
					    message = "#{@identity} identity must be available to build with #{@with}"
 | 
				
			||||||
 | 
					    message += ":\n#{@url}" if @url.present?
 | 
				
			||||||
 | 
					    message
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@ -27,7 +27,7 @@ class JavaRequirement < Requirement
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  def initialize(tags = [])
 | 
					  def initialize(tags = [])
 | 
				
			||||||
    @version = tags.shift if /(\d+\.)+\d/ =~ tags.first
 | 
					    @version = tags.shift if /(\d+\.)+\d/ =~ tags.first
 | 
				
			||||||
    super
 | 
					    super(tags)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def message
 | 
					  def message
 | 
				
			||||||
@ -39,7 +39,7 @@ class JavaRequirement < Requirement
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def inspect
 | 
					  def inspect
 | 
				
			||||||
    "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
 | 
					    "#<#{self.class.name}: #{tags.inspect} version=#{@version.inspect}>"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def display_s
 | 
					  def display_s
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,8 @@ class MacOSRequirement < Requirement
 | 
				
			|||||||
  fatal true
 | 
					  fatal true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(tags = [])
 | 
					  def initialize(tags = [])
 | 
				
			||||||
    @version = MacOS::Version.from_symbol(tags.first) unless tags.empty?
 | 
					    @version = MacOS::Version.from_symbol(tags.shift) unless tags.empty?
 | 
				
			||||||
    super
 | 
					    super(tags)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def minimum_version_specified?
 | 
					  def minimum_version_specified?
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,8 @@ class MaximumMacOSRequirement < Requirement
 | 
				
			|||||||
  fatal true
 | 
					  fatal true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(tags)
 | 
					  def initialize(tags)
 | 
				
			||||||
    @version = MacOS::Version.from_symbol(tags.first)
 | 
					    @version = MacOS::Version.from_symbol(tags.shift)
 | 
				
			||||||
    super
 | 
					    super(tags)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  satisfy(build_env: false) { MacOS.version <= @version }
 | 
					  satisfy(build_env: false) { MacOS.version <= @version }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
require "requirement"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class NonBinaryOsxfuseRequirement < Requirement
 | 
					 | 
				
			||||||
  fatal false
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
require "extend/os/requirements/non_binary_osxfuse_requirement"
 | 
					 | 
				
			||||||
@ -1,16 +0,0 @@
 | 
				
			|||||||
require "requirement"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class UnsignedKextRequirement < Requirement
 | 
					 | 
				
			||||||
  fatal true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  satisfy(build_env: false) { MacOS.version < :yosemite }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def message
 | 
					 | 
				
			||||||
    s = <<~EOS
 | 
					 | 
				
			||||||
      Building this formula from source isn't possible due to OS X
 | 
					 | 
				
			||||||
      Yosemite (10.10) and above's strict unsigned kext ban.
 | 
					 | 
				
			||||||
    EOS
 | 
					 | 
				
			||||||
    s += super
 | 
					 | 
				
			||||||
    s
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
@ -10,13 +10,6 @@ class X11Requirement < Requirement
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  env { ENV.x11 }
 | 
					  env { ENV.x11 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(name = "x11", tags = [])
 | 
					 | 
				
			||||||
    @name = name
 | 
					 | 
				
			||||||
    # no-op on version specified as a tag argument
 | 
					 | 
				
			||||||
    tags.shift if /(\d\.)+\d/ =~ tags.first
 | 
					 | 
				
			||||||
    super(tags)
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  def min_version
 | 
					  def min_version
 | 
				
			||||||
    "1.12.2"
 | 
					    "1.12.2"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
@ -51,7 +44,7 @@ class X11Requirement < Requirement
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def inspect
 | 
					  def inspect
 | 
				
			||||||
    "#<#{self.class.name}: #{name.inspect} #{tags.inspect}>"
 | 
					    "#<#{self.class.name}: #{tags.inspect}>"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -6,8 +6,8 @@ class XcodeRequirement < Requirement
 | 
				
			|||||||
  satisfy(build_env: false) { xcode_installed_version }
 | 
					  satisfy(build_env: false) { xcode_installed_version }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def initialize(tags = [])
 | 
					  def initialize(tags = [])
 | 
				
			||||||
    @version = tags.find { |tag| tags.delete(tag) if tag =~ /(\d\.)+\d/ }
 | 
					    @version = tags.shift if tags.first.to_s.match?(/(\d\.)+\d/)
 | 
				
			||||||
    super
 | 
					    super(tags)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def xcode_installed_version
 | 
					  def xcode_installed_version
 | 
				
			||||||
@ -40,6 +40,6 @@ class XcodeRequirement < Requirement
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def inspect
 | 
					  def inspect
 | 
				
			||||||
    "#<#{self.class.name}: #{name.inspect} #{tags.inspect} version=#{@version.inspect}>"
 | 
					    "#<#{self.class.name}: #{tags.inspect} version=#{@version.inspect}>"
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,7 @@ describe DependencyCollector do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    specify "requirement tags" do
 | 
					    specify "requirement tags" do
 | 
				
			||||||
      subject.add x11: "2.5.1"
 | 
					      subject.add :x11
 | 
				
			||||||
      subject.add xcode: :build
 | 
					      subject.add xcode: :build
 | 
				
			||||||
      expect(find_requirement(X11Requirement).tags).to be_empty
 | 
					      expect(find_requirement(X11Requirement).tags).to be_empty
 | 
				
			||||||
      expect(find_requirement(XcodeRequirement)).to be_a_build_requirement
 | 
					      expect(find_requirement(XcodeRequirement)).to be_a_build_requirement
 | 
				
			||||||
 | 
				
			|||||||
@ -798,7 +798,7 @@ describe Formula do
 | 
				
			|||||||
    stub_formula_loader(f1)
 | 
					    stub_formula_loader(f1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    java = JavaRequirement.new
 | 
					    java = JavaRequirement.new
 | 
				
			||||||
    x11 = X11Requirement.new("x11", [:recommended])
 | 
					    x11 = X11Requirement.new([:recommended])
 | 
				
			||||||
    xcode = XcodeRequirement.new(["1.0", :optional])
 | 
					    xcode = XcodeRequirement.new(["1.0", :optional])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    expect(Set.new(f1.recursive_requirements)).to eq(Set[java, x11])
 | 
					    expect(Set.new(f1.recursive_requirements)).to eq(Set[java, x11])
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,7 @@ describe JavaRequirement do
 | 
				
			|||||||
  describe "#inspect" do
 | 
					  describe "#inspect" do
 | 
				
			||||||
    subject { described_class.new(%w[1.7+]) }
 | 
					    subject { described_class.new(%w[1.7+]) }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    its(:inspect) { is_expected.to eq('#<JavaRequirement: "java" [] version="1.7+">') }
 | 
					    its(:inspect) { is_expected.to eq('#<JavaRequirement: [] version="1.7+">') }
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  describe "#display_s" do
 | 
					  describe "#display_s" do
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					require "requirements/codesign_requirement"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					describe CodesignRequirement do
 | 
				
			||||||
 | 
					  subject(:requirement) {
 | 
				
			||||||
 | 
					    described_class.new([{ identity: identity, with: with, url: url }])
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let(:identity) { "lldb_codesign" }
 | 
				
			||||||
 | 
					  let(:with) { "LLDB" }
 | 
				
			||||||
 | 
					  let(:url) {
 | 
				
			||||||
 | 
					    "https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  describe "#message" do
 | 
				
			||||||
 | 
					    it "includes all parameters" do
 | 
				
			||||||
 | 
					      expect(requirement.message).to include(identity)
 | 
				
			||||||
 | 
					      expect(requirement.message).to include(with)
 | 
				
			||||||
 | 
					      expect(requirement.message).to include(url)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
@ -1,9 +0,0 @@
 | 
				
			|||||||
require "requirements/non_binary_osxfuse_requirement"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
describe NonBinaryOsxfuseRequirement, :needs_macos do
 | 
					 | 
				
			||||||
  subject { described_class.new([]) }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  describe "#message" do
 | 
					 | 
				
			||||||
    its(:message) { is_expected.to match("osxfuse is already installed from the binary distribution") }
 | 
					 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
@ -14,13 +14,13 @@ describe Requirements do
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it "prefers the larger requirement when merging duplicates" do
 | 
					    it "prefers the larger requirement when merging duplicates" do
 | 
				
			||||||
      subject << X11Requirement.new << X11Requirement.new("x11", %w[2.6])
 | 
					      subject << X11Requirement.new << X11Requirement.new(%w[2.6])
 | 
				
			||||||
      expect(subject.to_a).to eq([X11Requirement.new("x11", %w[2.6])])
 | 
					      expect(subject.to_a).to eq([X11Requirement.new(%w[2.6])])
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it "does not use the smaller requirement when merging duplicates" do
 | 
					    it "does not use the smaller requirement when merging duplicates" do
 | 
				
			||||||
      subject << X11Requirement.new("x11", %w[2.6]) << X11Requirement.new
 | 
					      subject << X11Requirement.new(%w[2.6]) << X11Requirement.new
 | 
				
			||||||
      expect(subject.to_a).to eq([X11Requirement.new("x11", %w[2.6])])
 | 
					      expect(subject.to_a).to eq([X11Requirement.new(%w[2.6])])
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
@ -10,15 +10,10 @@ describe X11Requirement do
 | 
				
			|||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  describe "#eql?" do
 | 
					  describe "#eql?" do
 | 
				
			||||||
    it "returns true if the names are equal" do
 | 
					    it "returns true if the requirements are equal" do
 | 
				
			||||||
      other = described_class.new(default_name)
 | 
					      other = described_class.new
 | 
				
			||||||
      expect(subject).to eql(other)
 | 
					      expect(subject).to eql(other)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					 | 
				
			||||||
    it "and returns false if the names differ" do
 | 
					 | 
				
			||||||
      other = described_class.new("foo")
 | 
					 | 
				
			||||||
      expect(subject).not_to eql(other)
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  describe "#modify_build_environment" do
 | 
					  describe "#modify_build_environment" do
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user