-
Notifications
You must be signed in to change notification settings - Fork 127
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
Improve test framework #129
Conversation
9d1a0db
to
117b9aa
Compare
117b9aa
to
90196f3
Compare
test/support/utils.rb
Outdated
@@ -29,8 +31,6 @@ def debug_code(program, boot_options: '-r debug/run', remote: true, &block) | |||
debug_on_unix_domain_socket | |||
debug_on_tcpip | |||
end | |||
|
|||
check_line_num!(program) | |||
end | |||
|
|||
DEBUG_MODE = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see it become a env var so I can always enable it locally. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@st0012
Could you explain me more? I just moved check_line_num
up. It is always enable, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean can we make this:
DEBUG_MODE = ENV["RUBY_DEBUG_TEST_DEBUG_MODE"]
so I don't need to change the code to enabled it. like what you did and forgot to change it back (I've done this a lot too 😂 ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok. I thought you were talking about check_line_num
. I'll change DEBUG_MODE
, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASK_CMD = %w[quit delete kill undisplay] | ||
|
||
def debug_print msg | ||
print msg if DEBUG_MODE | ||
print msg if ENV['RUBY_DEBUG_TEST_DEBUG_MODE'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be
print msg if ENV['RUBY_DEBUG_TEST_DEBUG_MODE'] != "false"
because it's a string instead of boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That was my mistake.
0ebafe7
to
fd560c5
Compare
test/support/utils.rb
Outdated
ASK_CMD = %w[quit delete kill undisplay] | ||
|
||
def debug_print msg | ||
print msg if DEBUG_MODE | ||
print msg unless ENV['RUBY_DEBUG_TEST_DEBUG_MODE'] == 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ENV['RUBY_DEBUG_TEST_DEBUG_MODE']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fd560c5
to
a5cc039
Compare
Currently,
check_line_num
method will be executed after the test finished. The line numbers should be checked first becausetest/assertion_helper_test.rb
andtest/test_utils_test.rb
will exit beforecheck_line_num
method is executed. This PR will fix it.I also changed constant variable(
DEBUG_MODE
) to ENV variable(ENV["RUBY_DEBUG_TEST_DEBUG_MODE"]
).