Skip to content

Commit

Permalink
Use stricter check to skip prelude loading
Browse files Browse the repository at this point in the history
Fixes #865
  • Loading branch information
st0012 authored and ko1 committed Dec 22, 2022
1 parent ef639a2 commit 06fb3a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/debug/prelude.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

return if ENV['RUBY_DEBUG_ENABLE'] == '0'
return if defined?(::DEBUGGER__)
return if defined?(::DEBUGGER__::Session)

# Put the following line in your login script (e.g. ~/.bash_profile) with modified path:
#
Expand Down
9 changes: 9 additions & 0 deletions test/console/debugger_method_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,14 @@ def test_prelude_doesnt_override_debugger
type "c"
end
end

def test_require_config_doesnt_cancel_prelude
run_ruby(program, options: "-Ilib -rdebug/config") do
assert_line_num(5)
type "a + b"
assert_line_text(/120/)
type "c"
end
end
end
end

0 comments on commit 06fb3a2

Please sign in to comment.