Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ruby 2.5 test #711

Merged
merged 3 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
source "https://rubygems.org"
gemspec name: "train"

if Gem.ruby_version.to_s.start_with?("2.5")
# 16.7.23 required ruby 2.6+
gem "chef-utils", "< 16.7.23" # TODO: remove when we drop ruby 2.5
end

group :test do
gem "coveralls", require: false
gem "minitest", "~> 5.8"
Expand All @@ -19,10 +24,12 @@ group :test do
gem "mocha", "~> 1.1"
end

group :integration do
gem "berkshelf", ">= 6.0"
gem "test-kitchen", ">= 2"
gem "kitchen-vagrant"
if Gem.ruby_version >= Gem::Version.new("2.7.0")
group :integration do
gem "berkshelf", ">= 6.0"
gem "test-kitchen", ">= 2"
gem "kitchen-vagrant"
end
end

group :tools do
Expand Down
2 changes: 1 addition & 1 deletion test/unit/file/remote/linux_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def mock_stat(args, out, err = "", code = 0)

it "reads file contents" do
out = rand.to_s
backend.mock_command('cat /spaced\\ path || echo -n', out)
backend.mock_command("cat /spaced\\ path || echo -n", out)
_(cls.new(backend, "/spaced path").content).must_equal out
end

Expand Down