Skip to content

Commit

Permalink
Merge pull request #111 from alexjfisher/ruby_2_6
Browse files Browse the repository at this point in the history
Test on ruby 2.6
  • Loading branch information
bastelfreak authored Oct 4, 2019
2 parents 55ea82f + 55ac253 commit 0c6d7f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ script: bundle exec rake
rvm:
- 2.4.4
- 2.5.1
- 2.6.5
env:
- PUPPET_VERSION="~> 5.5.10"
- PUPPET_VERSION="~> 6.1.0"
Expand Down
11 changes: 9 additions & 2 deletions spec/puppet-syntax/templates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

describe PuppetSyntax::Templates do
let(:subject) { PuppetSyntax::Templates.new }
let(:conditional_warning_regex) do
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
%r{2: warning: found `= literal' in conditional}
else
%r{2: warning: found = in conditional}
end
end

it 'should expect an array of files' do
expect { subject.check(nil) }.to raise_error(/Expected an array of files/)
Expand Down Expand Up @@ -34,7 +41,7 @@
res = subject.check(files)

expect(res.size).to eq(1)
expect(res[0]).to match(/2: warning: found = in conditional/)
expect(res[0]).to match(conditional_warning_regex)
end

it 'should read more than one valid file' do
Expand All @@ -50,7 +57,7 @@

expect(res.size).to eq(2)
expect(res[0]).to match(/2: syntax error, unexpected/)
expect(res[1]).to match(/2: warning: found = in conditional/)
expect(res[1]).to match(conditional_warning_regex)
end

it 'should ignore a TypeError' do
Expand Down

0 comments on commit 0c6d7f2

Please sign in to comment.