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

⌈⌋ ⎇ branch:  cross package maker


Artifact [f919fc240c]

Artifact f919fc240c8e75490f339831fd427ea5544c0a0f:

  • File test/fpm/fpm_target_rpm.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: 1011) [more...]
  • File test/old/fpm_target_rpm.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: 1011)

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

describe FPM::Target::Rpm do
  it 'renders the spec 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)
    rpm = FPM::Target::Rpm.new(source)

    # Fix some properties of the package to get consistent output
    rpm.scripts = {}
    rpm.architecture = 'all'

    # Render the template and compare it to our canned output
    spec_output = rpm.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_rpm.spec')
    file_output = File.read(test_file)
    spec_output.must_equal file_output
  end
end