Skip to content

Commit

Permalink
Merge pull request #32 from chef/tp/ruby-version-berkshelf
Browse files Browse the repository at this point in the history
Fix version string comparison for Minitar and uncomment install feature
  • Loading branch information
johnmccrae authored Aug 14, 2024
2 parents cb35db3 + 4400ffa commit 7bdff08
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
14 changes: 8 additions & 6 deletions berkshelf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ Gem::Specification.new do |s|

s.add_dependency "chef-cleanroom", "~> 1.0"

if ruby_version >= "3.1"
if ruby_version >= Gem::Version.new("3.1.0")
s.add_dependency "minitar", "~> 1.0"
s.add_dependency "chef", ">= 18.0.0"
else
s.add_dependency "minitar", "~> 0.12"

if ruby_version >= Gem::Version.new("3.0.0")
s.add_dependency "chef", "~> 17.0" # needed for --skip-syntax-check
else
s.add_dependency "chef", ">= 15.7.32"
end
end

s.add_dependency "retryable", ">= 2.0", "< 4.0"
Expand All @@ -54,11 +61,6 @@ Gem::Specification.new do |s|

s.add_dependency "ffi", "~> 1.9", "< 1.16.0" #

if RUBY_VERSION.match?(/3.0/)
s.add_dependency "chef", "~> 17.0" # needed for --skip-syntax-check
elsif
s.add_dependency "chef", ">= 15.7.32"
end
s.add_dependency "chef-config"
# this is required for Mixlib::Config#from_json
s.add_dependency "mixlib-config", ">= 2.2.5"
Expand Down
42 changes: 21 additions & 21 deletions features/commands/install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -624,24 +624,24 @@ Feature: berks install
Resolving cookbook dependencies...
"""

# Scenario: when using a chef_repo source
# Given I use a fixture named "complex-cookbook-path"
# And a file named "Berksfile" with:
# """
# source chef_repo: '.'
#
# cookbook 'jenkins-config'
# """
# When I successfully run `berks install`
# Then the output should contain:
# """
# Installing jenkins (2.0.1) from
# """
# And the output should contain:
# """
# Installing jenkins-config (0.1.0) from
# """
# And the cookbook store should have the cookbooks:
# | jenkins | 2.0.1 |
# | jenkins-config | 0.1.0 |
#
Scenario: when using a chef_repo source
Given I use a fixture named "complex-cookbook-path"
And a file named "Berksfile" with:
"""
source chef_repo: '.'
cookbook 'jenkins-config'
"""
When I successfully run `berks install`
Then the output should contain:
"""
Installing jenkins (2.0.1) from
"""
And the output should contain:
"""
Installing jenkins-config (0.1.0) from
"""
And the cookbook store should have the cookbooks:
| jenkins | 2.0.1 |
| jenkins-config | 0.1.0 |

0 comments on commit 7bdff08

Please sign in to comment.