-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix undefined method error after previous change
After the previous change, one would get the error `undefined method `mode' for Byebug:Module` when running a file with `byebug` calls. A `require` call needed to be moved up.
- Loading branch information
1 parent
374d30f
commit 9948d64
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require "test_helper" | ||
|
||
module Byebug | ||
# | ||
# Tests standalone byebug when debugging a target program | ||
# | ||
class RunnerAgainstProgramWithByebugCallTest < TestCase | ||
def setup | ||
super | ||
|
||
example_file.write("require 'byebug'\nbyebug\nsleep 0") | ||
example_file.close | ||
end | ||
|
||
def test_run_with_a_script_to_debug | ||
stdout = run_program( | ||
["ruby", example_path], | ||
'puts "Program: #{$PROGRAM_NAME}"' | ||
) | ||
|
||
assert_match(/Program: #{example_path}/, stdout) | ||
end | ||
end | ||
end |