Sha256: 1587e0dfbde4a0e0641fcd3288597e39fb3f023f25b9accb03838fcfd976f3d7

Contents?: true

Size: 943 Bytes

Versions: 2

Compression:

Stored size: 943 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 'does 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 'detects 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 'detects 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-1.0.1 spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb
puppet-lint-spaceship_operator_without_tag-check-1.0.0 spec/puppet-lint/plugins/check_spaceship_operator_without_tag_spec.rb