Sha256: b323a98b66e23f26836c2cf4ed7482eba4a28378758502f51a812bf74580cf9a

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

module Danger
  describe Danger::DangerPuppetLint do
    it 'should be a plugin' do
      expect(Danger::DangerPuppetLint.new(nil)).to be_a Danger::Plugin
    end

    #
    # You should test your custom attributes and methods here
    #
    describe 'with Dangerfile' do
      before do
        @dangerfile = testing_dangerfile
        @my_plugin = @dangerfile.puppet_lint
      end

      it 'Parses file with warnings and errors' do
        path = File.expand_path('../test_summary.report', __FILE__)
        @my_plugin.report(path)
        expect(@dangerfile.status_report[:errors].length).to be == 3
        expect(@dangerfile.status_report[:warnings].length).to be == 19
        expect(@dangerfile.status_report[:markdowns]).to eq([])
      end

      it 'Parses empty file' do
        path = File.expand_path('../test_empty_summary.report', __FILE__)
        @my_plugin.report(path)
        expect(@dangerfile.status_report[:errors]).to eq([])
        expect(@dangerfile.status_report[:warnings]).to eq([])
        expect(@dangerfile.status_report[:markdowns]).to eq([])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danger-puppet_lint-1.0.2 spec/puppet_lint_spec.rb
danger-puppet_lint-1.0.1 spec/puppet_lint_spec.rb
danger-puppet_lint-1.0.0 spec/puppet_lint_spec.rb