spec/buildrdeb/package_spec.rb in buildrdeb-1.0.0 vs spec/buildrdeb/package_spec.rb in buildrdeb-1.0.1
- old
+ new
@@ -38,10 +38,32 @@
describing the function of the program, what
kind of features it has, and so on.
More descriptive text.
CONTROL
Buildr::write "control2", ""
+ Buildr::write "control3", <<-CONTROL
+Package: acme
+Version: 1.0
+Section: <%= MY_CUSTOM_VALUE %>
+Priority: optional
+Architecture: all
+Essential: no
+Depends: libwww-perl, acme-base (>= 1.2)
+Pre-Depends: perl
+Recommends: mozilla | netscape
+Suggests: docbook
+Installed-Size: 1024
+Maintainer: Joe Brockmeier <jzb@dissociatedpress.net>
+Conflicts: wile-e-coyote
+Replaces: sam-sheepdog
+Provides: acme
+Description: The description can contain free-form text
+ describing the function of the program, what
+ kind of features it has, and so on.
+ More descriptive text.
+CONTROL
+
Buildr::write "postinst", ""
Buildr::write "prerm", ""
Buildr::write "postinst2", <<-POSTINST2
bash generate_code(#\{MY_CUSTOM_VALUE\})
POSTINST2
@@ -128,21 +150,21 @@
File.exists?( project("foo").package(:deb).to_s).should be_true
File.exists?("target/foo-2.0.deb-contents/DEBIAN/control").should be_true
File.read("target/foo-2.0.deb-contents/DEBIAN/control").should match /^Version: 2.0$/
end
- it "should evaluate the contents of the file" do
+ it "should evaluate the contents of the control file" do
write_files
define("foo", :version => "2.0") do
project.package(:deb).tap do |deb|
- deb.control = _("control")
- deb.postinst = _("postinst2")
+ deb.control = _("control3")
+ deb.postinst = _("postinst")
deb.prerm = _("prerm")
end
end
MY_CUSTOM_VALUE = "custom"
project("foo").package(:deb).invoke
File.exists?( project("foo").package(:deb).to_s).should be_true
- File.exists?("target/foo-2.0.deb-contents/DEBIAN/postinst").should be_true
- File.read("target/foo-2.0.deb-contents/DEBIAN/postinst").should match MY_CUSTOM_VALUE
+ File.exists?("target/foo-2.0.deb-contents/DEBIAN/control").should be_true
+ File.read("target/foo-2.0.deb-contents/DEBIAN/control").should match MY_CUSTOM_VALUE
end
end
\ No newline at end of file