Permalink
Browse files

- Add test coverage for :no_depends?

  • Loading branch information...
jordansissel committed Nov 15, 2012
1 parent 02e0868 commit 82e1c5bbdaaae5faed924d23b2951e0cc31d9c1c
Showing with 36 additions and 1 deletion.
  1. +36 −1 spec/fpm/package/deb_spec.rb
@@ -9,7 +9,7 @@
have_dpkg_deb = program_in_path?("dpkg-deb")
if !have_dpkg_deb
Cabin::Channel.get("rspec") \
- .warn("Skipping Deb#output tests because 'dpkg-deb' isn't in your PATH")
+ .warn("Skipping some deb tests because 'dpkg-deb' isn't in your PATH")
end
after :each do
@@ -183,4 +183,39 @@ def dpkg_field(field)
end
end
end # #output
+
+ describe "#output with no depends" do
+ before :all do
+ # output a package, use it as the input, set the subject to that input
+ # package. This helps ensure that we can write and read packages
+ # properly.
+ tmpfile = Tempfile.new("fpm-test-deb")
+ @target = tmpfile.path
+ # The target file must not exist.
+ tmpfile.unlink
+
+ @original = FPM::Package::Deb.new
+ @original.name = "name"
+ @original.version = "123"
+ @original.iteration = "100"
+ @original.epoch = "5"
+ @original.architecture = "all"
+ @original.dependencies << "something > 10"
+ @original.dependencies << "hello >= 20"
+ @original.attributes[:no_depends?] = true
+ @original.output(@target)
+
+ @input = FPM::Package::Deb.new
+ @input.input(@target)
+ end
+
+ after :all do
+ @original.cleanup
+ @input.cleanup
+ end # after
+
+ it "should have no dependencies" do
+ insist { @input.dependencies }.empty?
+ end
+ end # #output with no dependencies
end # describe FPM::Package::Deb

0 comments on commit 82e1c5b

Please sign in to comment.