[ruby/irb] Disable debug cmd tests based on project structure
instead of env
(https://github.com/ruby/irb/pull/466)
It's hard to find an env var that's universally set in all Ruby CI
environments but not in local. Checking gemspec seems to be a better way
as `syntax_suggest` already uses it for a while.
d8f1bca297/spec/spec_helper.rb (L47)
This commit is contained in:
parent
e9e624b76e
commit
69fd673b1a
@ -36,6 +36,10 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ruby_core?
|
||||||
|
!Pathname(__dir__).join("../../", "irb.gemspec").exist?
|
||||||
|
end
|
||||||
|
|
||||||
def save_encodings
|
def save_encodings
|
||||||
@default_encoding = [Encoding.default_external, Encoding.default_internal]
|
@default_encoding = [Encoding.default_external, Encoding.default_internal]
|
||||||
@stdio_encodings = [STDIN, STDOUT, STDERR].map {|io| [io.external_encoding, io.internal_encoding] }
|
@stdio_encodings = [STDIN, STDOUT, STDERR].map {|io| [io.external_encoding, io.internal_encoding] }
|
||||||
|
@ -16,13 +16,16 @@ module TestIRB
|
|||||||
}
|
}
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
if ENV["GITHUB_ACTION_REPOSITORY"] != "ruby/irb"
|
if ruby_core?
|
||||||
omit "This test works only on ruby/irb CI"
|
omit "This test works only under ruby/irb"
|
||||||
|
end
|
||||||
|
|
||||||
|
if RUBY_ENGINE == 'truffleruby'
|
||||||
|
omit "This test runs with ruby/debug, which doesn't work with truffleruby"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_backtrace
|
def test_backtrace
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
def foo
|
def foo
|
||||||
binding.irb
|
binding.irb
|
||||||
@ -40,7 +43,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_debug
|
def test_debug
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'ruby'
|
write_ruby <<~'ruby'
|
||||||
binding.irb
|
binding.irb
|
||||||
puts "hello"
|
puts "hello"
|
||||||
@ -57,7 +59,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_next
|
def test_next
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'ruby'
|
write_ruby <<~'ruby'
|
||||||
binding.irb
|
binding.irb
|
||||||
puts "hello"
|
puts "hello"
|
||||||
@ -73,7 +74,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_break
|
def test_break
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
binding.irb
|
binding.irb
|
||||||
puts "Hello"
|
puts "Hello"
|
||||||
@ -90,7 +90,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_delete
|
def test_delete
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
binding.irb
|
binding.irb
|
||||||
puts "Hello"
|
puts "Hello"
|
||||||
@ -110,7 +109,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_step
|
def test_step
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
def foo
|
def foo
|
||||||
puts "Hello"
|
puts "Hello"
|
||||||
@ -129,7 +127,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_continue
|
def test_continue
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
binding.irb
|
binding.irb
|
||||||
puts "Hello"
|
puts "Hello"
|
||||||
@ -147,7 +144,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_finish
|
def test_finish
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
def foo
|
def foo
|
||||||
binding.irb
|
binding.irb
|
||||||
@ -166,7 +162,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_info
|
def test_info
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
def foo
|
def foo
|
||||||
a = "He" + "llo"
|
a = "He" + "llo"
|
||||||
@ -186,7 +181,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_catch
|
def test_catch
|
||||||
omit if RUBY_ENGINE == 'truffleruby'
|
|
||||||
write_ruby <<~'RUBY'
|
write_ruby <<~'RUBY'
|
||||||
binding.irb
|
binding.irb
|
||||||
1 / 0
|
1 / 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user