summaryrefslogtreecommitdiff
path: root/test/irb/helper.rb
diff options
context:
space:
mode:
authorStan Lo <[email protected]>2022-12-02 20:43:55 +0000
committergit <[email protected]>2022-12-02 20:43:59 +0000
commit69fd673b1a22039c7414a5eb4046d3bf54a0c750 (patch)
tree3bbff3bdd8d69a608e1ed50915f01e5482415754 /test/irb/helper.rb
parente9e624b76e1f1b2c8dd5d4a6eea7e55ab491822e (diff)
[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. https://github.com/ruby/syntax_suggest/blob/d8f1bca297a392b80b5d167e2be07cf6ac4feae3/spec/spec_helper.rb#L47
Diffstat (limited to 'test/irb/helper.rb')
-rw-r--r--test/irb/helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/irb/helper.rb b/test/irb/helper.rb
index a51e9a84b9..56ec1a8374 100644
--- a/test/irb/helper.rb
+++ b/test/irb/helper.rb
@@ -36,6 +36,10 @@ module TestIRB
end
end
+ def ruby_core?
+ !Pathname(__dir__).join("../../", "irb.gemspec").exist?
+ end
+
def save_encodings
@default_encoding = [Encoding.default_external, Encoding.default_internal]
@stdio_encodings = [STDIN, STDOUT, STDERR].map {|io| [io.external_encoding, io.internal_encoding] }