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 test runner exit bug #728

Merged
merged 2 commits into from
Oct 12, 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
2 changes: 1 addition & 1 deletion lib/irb/extend-command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module ExtendCommandBundle
#
# Same as <code>IRB.CurrentContext.exit</code>.
def irb_exit(ret = 0)
irb_context&.exit(ret)
irb_context.exit(ret)
end

# Displays current configuration.
Expand Down
9 changes: 0 additions & 9 deletions test/irb/test_completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@

module TestIRB
class CompletionTest < TestCase
def setup
# make sure require completion candidates are not cached
IRB::BaseCompletor.class_variable_set(:@@files_from_load_path, nil)
end

def teardown
IRB.conf[:MAIN_CONTEXT] = nil
end

def completion_candidates(target, bind)
IRB::RegexpCompletor.new.completion_candidates('', target, '', bind: bind)
end
Expand Down
6 changes: 5 additions & 1 deletion test/irb/test_irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,13 @@ def assert_dynamic_prompt(input_with_prompt)

private

def build_binding
Object.new.instance_eval { binding }
end

def build_irb
IRB.init_config(nil)
workspace = IRB::WorkSpace.new(TOPLEVEL_BINDING.dup)
workspace = IRB::WorkSpace.new(build_binding)

IRB.conf[:VERBOSE] = false
IRB::Irb.new(workspace, TestInputMethod.new)
Expand Down