Sha256: 96eaf8c00e0d88b0fb787ffbdf42216fe9fbfeffc53bfb72246b5bf5c15f9089

Contents?: true

Size: 1.82 KB

Versions: 1

Compression:

Stored size: 1.82 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 Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('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

1 entries across 1 versions & 1 rubygems

Version Path
puppet-check-2.0.1 spec/puppet-check/regression_check_spec.rb