Sha256: d8c7b16c6a8d8f9c28188a7e6c40797df145ba197a71b8c6a54601518ba73b83

Contents?: true

Size: 1.78 KB

Versions: 2

Compression:

Stored size: 1.78 KB

Contents

require_relative '../spec_helper'
require_relative '../../lib/puppet-check/regression_check'

# once a good config is loaded, bad configs would have no effect so failures are tested first; config is also tested before compilation so that the good config can be loaded at the end and used for compilation and regression tests
describe RegressionCheck do
  context '.config' do
    # json gem got messed up for the EOL Ruby versions
    if RUBY_VERSION.to_f >= 2.2
      it 'raise an appropriate error if the file is malformed' do
        expect { RegressionCheck.config(fixtures_dir + 'metadata.json') }.to raise_error(OctocatalogDiff::Errors::ConfigurationFileContentError, 'Configuration must define OctocatalogDiff::Config!')
      end
    end
    it 'loads in a good octocatalog-diff config file' do
      expect { RegressionCheck.config(octocatalog_diff_dir + 'octocatalog-diff.cfg.rb') }.not_to raise_exception
    end
    it 'loads in the settings from the file correctly' do
    end
  end

  context '.smoke' do
    # octocatalog-diff is returning a blank error for these tests
    unless File.directory?('/home/travis')
      it 'returns a pass for a successful catalog compilation' do
        expect { RegressionCheck.smoke(['good.example.com'], "#{octocatalog_diff_dir}octocatalog-diff.cfg.rb") }.not_to raise_exception
      end
      it 'returns a failure for a catalog with an error' do
        expect { RegressionCheck.smoke(['does_not_exist.example.com'], "#{octocatalog_diff_dir}octocatalog-diff.cfg.rb") }.to raise_error(OctocatalogDiff::Errors::CatalogError)
      end
    end
    it 'returns a failure for a good and bad catalog' do
      # RegressionCheck.smoke(['good.example.com', 'syntax_error.example.com'], "#{fixtures_dir}octocatalog-diff.cfg.rb")
    end
  end

  context '.regression' do
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-check-2.0.0 spec/puppet-check/regression_check_spec.rb
puppet-check-1.6.1 spec/puppet-check/regression_check_spec.rb