From 13f856e4b6cc90cb4b02b84b9732b4222d9bdec5 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Tue, 19 Nov 2024 13:38:11 -0800 Subject: [PATCH] Fix failing spec on ruby 3.3 Signed-off-by: Samuel Giddins --- lib/gemstash/version.rb | 2 +- spec/integration_spec.rb | 7 ++----- spec/support/exec_helpers.rb | 13 ++++++++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/gemstash/version.rb b/lib/gemstash/version.rb index 70ee42a4..b857f637 100644 --- a/lib/gemstash/version.rb +++ b/lib/gemstash/version.rb @@ -2,5 +2,5 @@ # :nodoc: module Gemstash - VERSION = "2.7.1" + VERSION = "2.8.0" end diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index 5cf5ebc0..84a3cef0 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -169,18 +169,15 @@ end it "finds private gems when just the private source is configured", db_transaction: false do - skip "this doesn't work because Rubygems sends /specs.4.8.gz instead of /private/specs.4.8.gz" env = { "HOME" => env_dir } - expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success - expect(execute("gem", ["source", "-a", host], env: env)).to exit_success + expect(execute("gem", ["source", "-r", "https://rubygems.org/", "-a", host], env: env)).to exit_success expect(execute("gem", ["search", "-ar", "speaker"], env: env)). to exit_success.and_output(/speaker \(0.1.0\)/) end it "finds private gems when just the private source is configured with a trailing slash", db_transaction: false do env = { "HOME" => env_dir } - expect(execute("gem", ["source", "-r", "https://rubygems.org/"], env: env)).to exit_success - expect(execute("gem", ["source", "-a", "#{host}/"], env: env)).to exit_success + expect(execute("gem", ["source", "-r", "https://rubygems.org/", "-a", "#{host}/"], env: env)).to exit_success expect(execute("gem", ["search", "-ar", "speaker"], env: env)). to exit_success.and_output(/speaker \(0.1.0\)/) end diff --git a/spec/support/exec_helpers.rb b/spec/support/exec_helpers.rb index cf526fb7..2ab98a96 100644 --- a/spec/support/exec_helpers.rb +++ b/spec/support/exec_helpers.rb @@ -144,7 +144,10 @@ def exec_in_process(binstub) #{@expected_output} but instead it output: -#{actual.output}" +#{actual.output} + +and the error was: +#{actual.err}" else "expected '#{actual.display_command}' in '#{actual.dir}' to exit with a success code, but it didn't. the command output was: @@ -154,4 +157,12 @@ def exec_in_process(binstub) #{actual.err}" end end + + failure_message_when_negated do |actual| + "expected '#{actual.display_command}' in '#{actual.dir}' to not exit with a success code, but it did +#{actual.output} + +and the error was: +#{actual.err}" + end end