summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2023-02-28 13:18:33 -0800
committerGitHub <noreply@github.com>2023-02-28 16:18:33 -0500
commitfb12a78c7bb3ef69f470934c0fa4c663b94cfe77 (patch)
tree7211cd11848fada1b224898aded83db1a7709b70
parentf31913f35f89523091fcaaddd181e05a290937f4 (diff)
downloadchef-fb12a78c7bb3ef69f470934c0fa4c663b94cfe77.tar.gz
Fix rubygem tests for 17 (#13615)
When the API server doesn't have a response, we expect nil, not a Ruby version. This was already fixed on 18, I'm just backporting. Also we only run uint tests on mac, so don't call them "mac" - just like 18. Signed-off-by: Phil Dibowitz <phil@ipom.com>
-rw-r--r--.github/workflows/unit_specs.yml16
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb2
2 files changed, 8 insertions, 10 deletions
diff --git a/.github/workflows/unit_specs.yml b/.github/workflows/unit_specs.yml
index a69eeffb79..b84cdfcb8d 100644
--- a/.github/workflows/unit_specs.yml
+++ b/.github/workflows/unit_specs.yml
@@ -9,18 +9,16 @@ name: unit_specs
jobs:
unit:
- strategy:
- fail-fast: false
- matrix:
- os: [macos-12]
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
- ruby: ['3.0']
- runs-on: ${{ matrix.os }}
+ runs-on: macos-latest
steps:
- uses: actions/checkout@v3
+ with:
+ clean: true
- uses: ruby/setup-ruby@v1
with:
- ruby-version: ${{ matrix.ruby }}
- bundler-cache: true
+ ruby-version: "3.0"
+ bundler-cache: false
+ - run: bundle update --bundler
+ - run: bundle install
- run: bundle exec rake spec:unit
- run: bundle exec rake component_specs
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index a4ffc1712e..f7a36ca1c5 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -143,7 +143,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
.to_return(status: 200, body: File.binread(File.join(CHEF_SPEC_DATA, "rubygems.org", "sexp_processor-4.15.1.gemspec.rz")))
dep = Gem::Dependency.new("sexp_processor", ">= 0")
- expect(@gem_env.candidate_version_from_remote(dep, "https://rubygems2.org")).to be_kind_of(Gem::Version)
+ expect(@gem_env.candidate_version_from_remote(dep, "https://rubygems2.org")).to be_nil
end
end