Sha256: 749b0aa401f15004466aeffe30f2e0801f34804cb30bcfc5f903ceed60ca9ddd

Contents?: true

Size: 917 Bytes

Versions: 2

Compression:

Stored size: 917 Bytes

Contents

require 'spec_helper'

describe 'spaceship_operator_without_tag' do
  let(:msg) { 'spaceship operator without tag' }

  context 'with fix disabled' do
    context 'spaceship operator with tag' do
      let(:code) do
        <<-EOS
Foo<| tag != 'virtual' |>
Bar<| tag == 'bar' |> -> Baz <| tag == 'baz' |>
        EOS
      end

      it 'should not detect any problems' do
        expect(problems).to have(0).problems
      end
    end

    context 'spaceship operator without tag' do
      let(:code) do
        <<-EOS
Foo<| |>
        EOS
      end

      it 'should detect a problems' do
        expect(problems).to have(1).problems
      end
    end

    context 'spaceship operator with and without tag' do
      let(:code) do
        <<-EOS
Bar<| tag == 'bar' |> -> Baz <| |>
        EOS
      end

      it 'should detect a problems' do
        expect(problems).to have(1).problems
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-lint-spaceship_operator_without_tag-check-0.1.1 spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
puppet-lint-spaceship_operator_without_tag-check-0.1.0 spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb