Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ ⎇ branch:  cross package maker


Artifact [61cf40cd49]

Artifact 61cf40cd49dda0cb11acbb617f44669d81aa0bf2:

  • File test/fpm/fpm_target_deb.rb — part of check-in [5279f5e5af] at 2012-01-02 11:15:21 on branch trunk — Add beginnings of MiniTest::Spec support, and some basic template tests. (user: ohookins@gmail.com size: 1069) [more...]
  • File test/old/fpm_target_deb.rb — part of check-in [40571c6988] at 2012-02-24 07:43:42 on branch trunk — - move older minitest tests away until they can be refactored to the new api (user: jls@semicomplete.com size: 1069)

require 'rubygems'
require 'minitest/autorun'
require 'fpm/target/deb'
require 'fpm/source/dir'
require 'erb'

describe FPM::Target::Deb do
  it 'renders the control file template correctly' do
    # Use the 'dir' source as it is the simplest to test in isolation
    root = File.join(File.dirname(__FILE__), 'test_data')
    # paths = root = File.join(File.dirname(__FILE__), 'test_data')
    # FIXME: Should be a fully-specifed path, but needs
    # some fixes in the path handling to remove the root components.
    paths = './test_data/dir/'
    source = FPM::Source::Dir.new(paths, root)
    deb = FPM::Target::Deb.new(source)

    # Fix some properties of the package to get consistent output
    deb.scripts = {}
    deb.architecture = 'all'
    deb.maintainer = '<testdude@example.com>'

    # Render the template and compare it to our canned output
    control_output = deb.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_deb.control')
    file_output = File.read(test_file)
    control_output.must_equal file_output
  end
end