Skip to content

Commit

Permalink
Make validates cleanly spec compatible with RubyGems 3.5+
Browse files Browse the repository at this point in the history
`rubygems/mock_gem_ui` was removed in RubyGems 3.5+:

rubygems/rubygems#6623

Luckily, other PR allowed to use standard RSpec methods for `$stdout`
testing:

rubygems/rubygems#7203

Fixes enkessler#190
  • Loading branch information
voxik committed Dec 20, 2023
1 parent 9d387d6 commit 9742a0c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spec/childprocess_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# encoding: utf-8

require File.expand_path('../spec_helper', __FILE__)
require 'rubygems/mock_gem_ui'


describe ChildProcess do
Expand All @@ -11,12 +10,17 @@
let(:gemspec) { eval(File.read "#{here}/../childprocess.gemspec") }

it 'validates cleanly' do
mock_ui = Gem::MockGemUi.new
Gem::DefaultUserInteraction.use_ui(mock_ui) { gemspec.validate }
if Gem::VERSION >= "3.5.0"
expect { gemspec.validate }.not_to output(/warn/i).to_stderr
else
require 'rubygems/mock_gem_ui'

expect(mock_ui.error).to_not match(/warn/i)
end
mock_ui = Gem::MockGemUi.new
Gem::DefaultUserInteraction.use_ui(mock_ui) { gemspec.validate }

expect(mock_ui.error).to_not match(/warn/i)
end
end

it "returns self when started" do
process = sleeping_ruby
Expand Down

0 comments on commit 9742a0c

Please sign in to comment.