Sha256: ab308048a5984a5e1d078a9ee3ad91439f12ae6bf1c0ee897ad1f0cec0304e00

Contents?: true

Size: 1.74 KB

Versions: 20

Compression:

Stored size: 1.74 KB

Contents

require 'simp/relchecks'
require 'spec_helper'

describe 'Simp::RelChecks.check_rpm_changelog' do
  let(:files_dir) {
    File.join( File.dirname(__FILE__), 'files', File.basename(__FILE__, '.rb'))
  }

  let(:templates_dir) {
    File.join( File.dirname(__FILE__), '..', '..', '..', 'lib', 'simp', 'rake',
      'helpers', 'assets', 'rpm_spec' )
  }

  context 'with no project changelog errors' do
    it 'succeeds for a Puppet module' do
      component_dir = File.join(files_dir, 'module')
      component_spec = File.join(templates_dir, 'simpdefault.spec')

      expect{ Simp::RelChecks.check_rpm_changelog(component_dir, component_spec) }.
        to_not raise_error
    end

    it 'succeeds for a non-Puppet asset' do
      component_dir = File.join(files_dir, 'asset')
      component_spec = File.join(component_dir, 'build', 'asset.spec')

      expect{ Simp::RelChecks.check_rpm_changelog(component_dir, component_spec) }.
        to_not raise_error
    end
  end

  context 'with changelog errors' do
    it 'fails for a Puppet module' do
      component_dir = File.join(files_dir, 'module_with_misordered_entries')
      component_spec = File.join(templates_dir, 'simpdefault.spec')

      expect{ Simp::RelChecks.check_rpm_changelog(component_dir, component_spec) }.
        to raise_error(/ERROR: Invalid changelog for module_with_misordered_entries/)
    end

    it 'fails for a non-Puppet asset' do
      component_dir = File.join(files_dir, 'asset_with_misordered_entries')
      component_spec = File.join(component_dir, 'build', 'asset_with_misordered_entries.spec')

      expect{ Simp::RelChecks.check_rpm_changelog(component_dir, component_spec) }.
        to raise_error(/ERROR: Invalid changelog for asset_with_misordered_entries/)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
simp-rake-helpers-5.11.4 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.11.3 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.11.2 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.11.1 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.11.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.10.2 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.10.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.9.1 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.9.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.8.3 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.8.2 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.8.1 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.8.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.7.1 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.7.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.6.2 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.6.1 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.6.0 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.5.3 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb
simp-rake-helpers-5.5.2 spec/lib/simp/relchecks_check_rpm_changelog_spec.rb