From f55312345d074eb8a6d4c21fdbea1f470ec8f2ca Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Mon, 22 Nov 2021 15:12:11 +0530 Subject: [PATCH 1/3] Fix ruby 2.5 test Signed-off-by: Vasu1105 --- Gemfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 1f388f25..8345e3f9 100644 --- a/Gemfile +++ b/Gemfile @@ -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" From 416adbcb05da2b4b77d3278266b8b2ef75ebbc86 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Mon, 22 Nov 2021 15:27:31 +0530 Subject: [PATCH 2/3] Fix ruby 2.5 test Signed-off-by: Vasu1105 --- Gemfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 8345e3f9..96b68623 100644 --- a/Gemfile +++ b/Gemfile @@ -24,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 From 94fdbabde402f294abfae65e7c7bb6db2e4a1154 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Mon, 22 Nov 2021 15:31:49 +0530 Subject: [PATCH 3/3] Fix lint test Signed-off-by: Vasu1105 --- test/unit/file/remote/linux_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/file/remote/linux_test.rb b/test/unit/file/remote/linux_test.rb index 8fc580dc..a8cb7d90 100644 --- a/test/unit/file/remote/linux_test.rb +++ b/test/unit/file/remote/linux_test.rb @@ -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