Skip to content

Commit

Permalink
Fix failing spec on ruby 3.3
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Giddins <[email protected]>
  • Loading branch information
segiddins committed Nov 20, 2024
1 parent 93a8a01 commit 408a581
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/gemstash/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# :nodoc:
module Gemstash
VERSION = "2.7.1"
VERSION = "2.8.0"
end
7 changes: 2 additions & 5 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,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
Expand Down
13 changes: 12 additions & 1 deletion spec/support/exec_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,22 @@ 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:
#{actual.output}"
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

0 comments on commit 408a581

Please sign in to comment.