Skip to content

Commit 706552a

Browse files
Add tests for CPAN->Deb features added by PR 1947
1 parent f22581a commit 706552a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

spec/fpm/package/deb_spec.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require "fpm" # local
44
require "fpm/package/deb" # local
55
require "fpm/package/dir" # local
6+
require "fpm/package/cpan" # local
67
require "stud/temporary"
78
require "English" # for $CHILD_STATUS
89

@@ -353,6 +354,37 @@ def dpkg_field(field)
353354
end
354355
end # #output with no dependencies
355356

357+
describe "#output converted from CPAN" do
358+
skip("Missing cpanm program") unless program_exists?("cpanm")
359+
360+
let(:input) { FPM::Package::CPAN.new }
361+
let(:input_name) { "Digest::MD5" }
362+
363+
before :each do
364+
input.instance_variable_set(:@version, "2.58");
365+
input.attributes[:cpan_test?] = false
366+
input.attributes[:rejects] = ['vars','warnings','strict','Config']
367+
end
368+
369+
after :each do
370+
input.cleanup
371+
end
372+
373+
it "should ignore dependencies in attributes[:rejects]" do
374+
input.attributes[:rejects] += ["Digest::base", "XSLoader"]
375+
input.input(input_name)
376+
package = input.convert(FPM::Package::Deb)
377+
insist { package.dependencies.sort } == ["perl (>= 5.006)"]
378+
end
379+
380+
it "should name package and deps according to Debians Perl packaging standard" do
381+
input.input(input_name)
382+
package = input.convert(FPM::Package::Deb)
383+
insist { package.name } == "libdigest-md5-perl"
384+
insist { package.dependencies.sort.first } == "libdigest-base-perl (>= 1.00)"
385+
end
386+
end # #output converted from CPAN
387+
356388
describe "#tar_flags" do
357389
let(:package) { FPM::Package::Deb.new }
358390

0 commit comments

Comments
 (0)