Sha256: d5196e7407d2683561e67d66567c99415664e5dbb751ba0bed4ff18b7d3c41b7

Contents?: true

Size: 595 Bytes

Versions: 4

Compression:

Stored size: 595 Bytes

Contents

require 'spec_helper'

describe 'numeric_variable' do
  let(:msg) { 'variable is solely numeric' }

  context 'a variable that is a number' do
    let(:code) { "$3 = 'foo'" }

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

    it 'should create a warning' do
      expect(problems).to contain_warning(msg).on_line(1).in_column(1)
    end
  end
  context 'a variable that is partially a number' do
    let(:code) { "$l33t = 'foo'" }

    it 'should only detect a single problem' do
      expect(problems).to have(0).problem
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-lint-numericvariable-1.0.3 spec/puppet-lint/plugins/numeric_variable_spec.rb
puppet-lint-numericvariable-1.0.2 spec/puppet-lint/plugins/numeric_variable_spec.rb
puppet-lint-numericvariable-1.0.1 spec/puppet-lint/plugins/numeric_variable_spec.rb
puppet-lint-numericvariable-1.0.0 spec/puppet-lint/plugins/numeric_variable_spec.rb