Add test coverage for #591
This also required fixing some bugs where FPM::Package::Deb mistakenly made 'provides' a string (in the tests and in the 'input' method)
This commit is contained in:
parent
2ffa1b1fde
commit
ff2126449d
|
|
@ -225,7 +225,10 @@ class FPM::Package::Deb < FPM::Package
|
|||
self.name = parse.call("Package")
|
||||
self.url = parse.call("Homepage")
|
||||
self.vendor = parse.call("Vendor") || self.vendor
|
||||
self.provides = parse.call("Provides") || self.provides
|
||||
with(parse.call("Provides")) do |provides_str|
|
||||
next if provides_str.nil?
|
||||
self.provides = provides_str.split(/\s*,\s*/)
|
||||
end
|
||||
|
||||
# The description field is a special flower, parse it that way.
|
||||
# The description is the first line as a normal Description field, but also continues
|
||||
|
|
@ -297,6 +300,7 @@ class FPM::Package::Deb < FPM::Package
|
|||
end # def extract_files
|
||||
|
||||
def output(output_path)
|
||||
self.provides = self.provides.collect { |p| fix_provides(p) }
|
||||
output_check(output_path)
|
||||
# Abort if the target path already exists.
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,10 @@ describe FPM::Package::Deb do
|
|||
@original.architecture = "all"
|
||||
@original.dependencies << "something > 10"
|
||||
@original.dependencies << "hello >= 20"
|
||||
@original.provides = "#{@original.name} = #{@original.version}"
|
||||
@original.provides << "#{@original.name} = #{@original.version}"
|
||||
|
||||
# Test to cover PR#591 (fix provides names)
|
||||
@original.provides << "Some-SILLY_name"
|
||||
|
||||
@original.conflicts = ["foo < 123"]
|
||||
@original.attributes[:deb_breaks] = ["baz < 123"]
|
||||
|
|
@ -169,7 +172,11 @@ describe FPM::Package::Deb do
|
|||
|
||||
it "should ignore versions and conditions in 'provides' (#280)" do
|
||||
# Provides is an array because rpm supports multiple 'provides'
|
||||
insist { @input.provides } == [ @original.name ]
|
||||
insist { @input.provides }.include?(@original.name)
|
||||
end
|
||||
|
||||
it "should fix capitalization and underscores-to-dashes (#591)" do
|
||||
insist { @input.provides }.include?("some-silly-name")
|
||||
end
|
||||
end # package attributes
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue