Skip to content

Commit

Permalink
Merge pull request #611 from scotje/maint_fix_package_tests_ruby_245
Browse files Browse the repository at this point in the history
(MAINT) Fix package acceptance tests to pass with any Ruby 2.4.x
  • Loading branch information
rodjek authored Jan 7, 2019
2 parents 24ff96b + 6a413ef commit 1fb549a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ script:
- cat Gemfile.lock
- bundle list
- bundle exec rake $CHECK
before_install: gem install bundler
before_install:
- if [ $BUNDLER_VERSION ]; then
gem install -v $BUNDLER_VERSION bundler --no-document;
else
gem install bundler --no-document;
fi
cache: bundler
matrix:
include:
Expand All @@ -23,7 +28,7 @@ matrix:
- rvm: 2.3
env: CHECK=spec
- rvm: 2.1.9
env: CHECK=spec
env: CHECK=spec BUNDLER_VERSION=1.17.3
branches:
only:
- master
Expand Down
8 changes: 4 additions & 4 deletions package-testing/spec/package/version_selection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
describe 'Test puppet & ruby version selection' do
module_name = 'version_selection'
test_cases = [
{ envvar: 'PDK_PUPPET_VERSION', version: '5.5.0', expected_puppet: '5.5', expected_ruby: '2.4.4' },
{ envvar: 'PDK_PUPPET_VERSION', version: '5.5.0', expected_puppet: '5.5', expected_ruby: '2.4' },
{ envvar: 'PDK_PUPPET_VERSION', version: '4.10.10', expected_puppet: '4.10', expected_ruby: '2.1.9' },
{ envvar: 'PDK_PE_VERSION', version: '2017.3', expected_puppet: '5.3', expected_ruby: '2.4.4' },
{ envvar: 'PDK_PE_VERSION', version: '2017.3', expected_puppet: '5.3', expected_ruby: '2.4' },
{ envvar: 'PDK_PE_VERSION', version: '2017.2', expected_puppet: '4.10', expected_ruby: '2.1.9' },
]

Expand Down Expand Up @@ -38,8 +38,8 @@

describe command('pdk bundle exec ruby --version') do
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.to match(%r{using ruby #{Regexp.escape(test_case[:expected_ruby])}}im) }
its(:stderr) { is_expected.to match(%r{^ruby #{Regexp.escape(test_case[:expected_ruby])}p}im) }
its(:stderr) { is_expected.to match(%r{using ruby #{Regexp.escape(test_case[:expected_ruby])}[\.0-9]*}im) }
its(:stderr) { is_expected.to match(%r{^ruby #{Regexp.escape(test_case[:expected_ruby])}[\.0-9]*p}im) }
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion pdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.1.9'

spec.add_runtime_dependency 'bundler', '~> 1.15'
spec.add_runtime_dependency 'bundler', '>= 1.15.0', '< 3.0.0'
spec.add_runtime_dependency 'cri', '~> 2.10.1'
spec.add_runtime_dependency 'childprocess', '~> 0.7.1'
spec.add_runtime_dependency 'gettext-setup', '~> 0.24'
Expand All @@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'diff-lcs', '1.3'
spec.add_runtime_dependency 'minitar', '~> 0.6.1'
spec.add_runtime_dependency 'pathspec', '~> 0.2.1'
spec.add_runtime_dependency 'ffi', '~> 1.9.0'

# Used in the pdk-templates
spec.add_runtime_dependency 'deep_merge', '~> 1.1'
Expand Down

0 comments on commit 1fb549a

Please sign in to comment.