Skip to content

Commit 06fb3a2

Browse files
st0012ko1
authored andcommitted
Use stricter check to skip prelude loading
Fixes #865
1 parent ef639a2 commit 06fb3a2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/debug/prelude.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
return if ENV['RUBY_DEBUG_ENABLE'] == '0'
4-
return if defined?(::DEBUGGER__)
4+
return if defined?(::DEBUGGER__::Session)
55

66
# Put the following line in your login script (e.g. ~/.bash_profile) with modified path:
77
#

test/console/debugger_method_test.rb

+9
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,14 @@ def test_prelude_doesnt_override_debugger
208208
type "c"
209209
end
210210
end
211+
212+
def test_require_config_doesnt_cancel_prelude
213+
run_ruby(program, options: "-Ilib -rdebug/config") do
214+
assert_line_num(5)
215+
type "a + b"
216+
assert_line_text(/120/)
217+
type "c"
218+
end
219+
end
211220
end
212221
end

0 commit comments

Comments
 (0)