Skip to content

Commit

Permalink
Rspec tests match the updated warning text.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnelson0 committed Aug 13, 2016
1 parent fa49175 commit 8a4e8da
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions spec/puppet-lint/plugins/check_whitespace/arrow_alignment_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'arrow_alignment' do
let(:msg) { 'indentation of => is not properly aligned' }
let(:msg) { 'indentation of => is not properly aligned (expected in column %d, but found it in column %d)' }

context 'with fix disabled' do
context 'selectors inside a resource' do
Expand Down Expand Up @@ -119,10 +119,10 @@ class { 'lvs::base':
end

it 'should create four warnings' do
expect(problems).to contain_warning(msg).on_line(3).in_column(15)
expect(problems).to contain_warning(msg).on_line(4).in_column(15)
expect(problems).to contain_warning(msg).on_line(6).in_column(16)
expect(problems).to contain_warning(msg).on_line(7).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(3).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(4).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,16)).on_line(6).in_column(16)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(7).in_column(15)
end
end

Expand All @@ -142,10 +142,10 @@ class { 'lvs::base':
end

it 'should create four warnings' do
expect(problems).to contain_warning(msg).on_line(3).in_column(15)
expect(problems).to contain_warning(msg).on_line(4).in_column(15)
expect(problems).to contain_warning(msg).on_line(6).in_column(16)
expect(problems).to contain_warning(msg).on_line(7).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(3).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(4).in_column(15)
expect(problems).to contain_warning(sprintf(msg,17,16)).on_line(6).in_column(16)
expect(problems).to contain_warning(sprintf(msg,17,15)).on_line(7).in_column(15)
end
end
context 'complex resource with a misaligned =>' do
Expand All @@ -166,9 +166,9 @@ class { 'lvs::base':
end

it 'should create three warnings' do
expect(problems).to contain_warning(msg).on_line(3).in_column(15)
expect(problems).to contain_warning(msg).on_line(6).in_column(17)
expect(problems).to contain_warning(msg).on_line(9).in_column(15)
expect(problems).to contain_warning(sprintf(msg,16,15)).on_line(3).in_column(15)
expect(problems).to contain_warning(sprintf(msg,19,17)).on_line(6).in_column(17)
expect(problems).to contain_warning(sprintf(msg,16,15)).on_line(9).in_column(15)
end
end

Expand All @@ -189,7 +189,7 @@ class { 'lvs::base':
end

it 'should create a warning' do
expect(problems).to contain_warning(msg).on_line(8).in_column(17)
expect(problems).to contain_warning(sprintf(msg,19,17)).on_line(8).in_column(17)
end
end

Expand All @@ -214,10 +214,10 @@ class { 'lvs::base':
end

it 'should create a warning' do
expect(problems).to contain_warning(msg).on_line(5).in_column(19)
expect(problems).to contain_warning(msg).on_line(6).in_column(18)
expect(problems).to contain_warning(msg).on_line(11).in_column(19)
expect(problems).to contain_warning(msg).on_line(12).in_column(18)
expect(problems).to contain_warning(sprintf(msg,20,19)).on_line(5).in_column(19)
expect(problems).to contain_warning(sprintf(msg,20,18)).on_line(6).in_column(18)
expect(problems).to contain_warning(sprintf(msg,20,19)).on_line(11).in_column(19)
expect(problems).to contain_warning(sprintf(msg,20,18)).on_line(12).in_column(18)
end
end

Expand Down Expand Up @@ -282,8 +282,8 @@ class { 'lvs::base':
end

it 'should create 2 warnings' do
expect(problems).to contain_warning(msg).on_line(3).in_column(19)
expect(problems).to contain_warning(msg).on_line(4).in_column(19)
expect(problems).to contain_warning(sprintf(msg,18,19)).on_line(3).in_column(19)
expect(problems).to contain_warning(sprintf(msg,18,19)).on_line(4).in_column(19)
end
end

Expand Down Expand Up @@ -314,8 +314,8 @@ class { 'lvs::base':
end

it 'should create 2 warnings' do
expect(problems).to contain_warning(msg).on_line(3).in_column(13)
expect(problems).to contain_warning(msg).on_line(3).in_column(26)
expect(problems).to contain_warning(sprintf(msg,15,13)).on_line(3).in_column(13)
expect(problems).to contain_warning(sprintf(msg,15,26)).on_line(3).in_column(26)
end
end

Expand Down Expand Up @@ -368,10 +368,10 @@ class { 'lvs::base':
end

it 'should fix the manifest' do
expect(problems).to contain_fixed(msg).on_line(3).in_column(15)
expect(problems).to contain_fixed(msg).on_line(4).in_column(15)
expect(problems).to contain_fixed(msg).on_line(6).in_column(16)
expect(problems).to contain_fixed(msg).on_line(7).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,17,15)).on_line(3).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,17,15)).on_line(4).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,17,16)).on_line(6).in_column(16)
expect(problems).to contain_fixed(sprintf(msg,17,15)).on_line(7).in_column(15)
end

it 'should align the arrows' do
Expand Down Expand Up @@ -408,9 +408,9 @@ class { 'lvs::base':
end

it 'should fix the manifest' do
expect(problems).to contain_fixed(msg).on_line(3).in_column(15)
expect(problems).to contain_fixed(msg).on_line(6).in_column(17)
expect(problems).to contain_fixed(msg).on_line(9).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,16,15)).on_line(3).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,19,17)).on_line(6).in_column(17)
expect(problems).to contain_fixed(sprintf(msg,16,15)).on_line(9).in_column(15)
end

it 'should align the arrows' do
Expand Down Expand Up @@ -445,7 +445,7 @@ class { 'lvs::base':
end

it 'should fix the manifest' do
expect(problems).to contain_fixed(msg).on_line(8).in_column(17)
expect(problems).to contain_fixed(sprintf(msg,19,17)).on_line(8).in_column(17)
end

it 'should align the arrows' do
Expand Down Expand Up @@ -473,8 +473,8 @@ class { 'lvs::base':
end

it 'should create 2 warnings' do
expect(problems).to contain_fixed(msg).on_line(3).in_column(19)
expect(problems).to contain_fixed(msg).on_line(4).in_column(19)
expect(problems).to contain_fixed(sprintf(msg,18,19)).on_line(3).in_column(19)
expect(problems).to contain_fixed(sprintf(msg,18,19)).on_line(4).in_column(19)
end

it 'should realign the arrows with the minimum whitespace' do
Expand Down Expand Up @@ -502,7 +502,7 @@ class { 'lvs::base':
end

it 'should fix the problem' do
expect(problems).to contain_fixed(msg).on_line(4).in_column(17)
expect(problems).to contain_fixed(sprintf(msg,18,17)).on_line(4).in_column(17)
end

it 'should add whitespace between the param and the arrow' do
Expand Down Expand Up @@ -531,8 +531,8 @@ class { 'lvs::base':
end

it 'should fix 2 problems' do
expect(problems).to contain_fixed(msg).on_line(3).in_column(13)
expect(problems).to contain_fixed(msg).on_line(3).in_column(26)
expect(problems).to contain_fixed(sprintf(msg,15,13)).on_line(3).in_column(13)
expect(problems).to contain_fixed(sprintf(msg,15,26)).on_line(3).in_column(26)
end

it 'should move the extra param onto its own line and realign' do
Expand Down Expand Up @@ -561,9 +561,9 @@ class { 'lvs::base':
end

it 'should fix 2 problems' do
expect(problems).to contain_fixed(msg).on_line(3).in_column(13)
expect(problems).to contain_fixed(msg).on_line(3).in_column(29)
expect(problems).to contain_fixed(msg).on_line(4).in_column(15)
expect(problems).to contain_fixed(sprintf(msg,17,13)).on_line(3).in_column(13)
expect(problems).to contain_fixed(sprintf(msg,17,29)).on_line(3).in_column(29)
expect(problems).to contain_fixed(sprintf(msg,17,15)).on_line(4).in_column(15)
end

it 'should move the extra param onto its own line and realign' do
Expand Down

0 comments on commit 8a4e8da

Please sign in to comment.