Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI failure #1464

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions test/stdlib/Kernel_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def (obj = BasicObject.new).inspect
def test_pp
pp
pp 1
pp 'a', 2
pp 'a', 2

pp Object.new
end
Expand Down Expand Up @@ -704,9 +704,6 @@ def o.divmod(i)
[0.001, 0.001]
end
sleep o

omit_if(RUBY_VERSION < "3.3.0")
sleep nil
end

def test_syscall
Expand Down
20 changes: 19 additions & 1 deletion test/stdlib/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ class Test::Unit::TestCase
prepend TestSkip
end

class Test::Unit::TestCase
module Printer
def setup
STDERR.puts name
super
end
end

# prepend Printer
end

module Spy
def self.wrap(object, method_name)
spy = WrapSpy.new(object: object, method_name: method_name)
Expand Down Expand Up @@ -460,7 +471,7 @@ def initialize(*args)
def to_ary
@args
end
end
end

class ToHash
def initialize(hash = { 'hello' => 'world' })
Expand Down Expand Up @@ -578,6 +589,11 @@ def self.hook
end
end

# def setup
# STDERR.puts name
# super
# end

def hook
self.class.hook
end
Expand All @@ -591,9 +607,11 @@ def setup
null = StringIO.new
@stdout, @stderr = $stdout, $stderr
$stderr = $stdout = null
super
end

def teardown
super
$stderr, $stdout = @stderr, @stdout
end
end
Expand Down