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

Ruby Syntax Error Checker Hangs Test Runner #1081

Closed
spmartinapl opened this issue Nov 6, 2019 · 2 comments · Fixed by #1082
Closed

Ruby Syntax Error Checker Hangs Test Runner #1081

spmartinapl opened this issue Nov 6, 2019 · 2 comments · Fixed by #1082
Assignees
Labels
bug
Milestone

Comments

@spmartinapl
Copy link

@spmartinapl spmartinapl commented Nov 6, 2019

The Test Runner fails to open on certain Ruby syntax errors, specifically missing end curly braces in puts statements that include variables.

puts "#{foo" for example.

Steps to reproduce the behavior

  1. Create a test group which has a puts statement syntax error like below (missing curly end brace)
    puts "#{foo
  2. Load Test Runner.
  3. It should fail to open and hang on the below screen. The syntax error, however, is not reported.
    image

Expected behavior
For comparison, vanilla ruby fails in the follow manner when I try to run a script with the same syntax error. See below for the test script.

#!/usr/bin/ruby
def syntax_test
    foo = 12
    puts "Hello"
    puts "Hello #{foo"
    puts "Done"
end
sytanx_test

See below for the syntax error thrown.
image

Environment

  • OS: Ubuntu v18.04.3 LTS
  • COSMOS v4.4.0
@jasonatball

This comment has been minimized.

Copy link
Collaborator

@jasonatball jasonatball commented Nov 6, 2019

@spmartinapl You can test my fix by going to line 523 of lib/cosmos/tools/script_runner/script_runner_frame.rb and adding:
eval("lambda { #{text} }")

To find the file click Help->About and clicking "Open COSMOS Gem Code"

@spmartinapl

This comment has been minimized.

Copy link
Author

@spmartinapl spmartinapl commented Nov 6, 2019

This line appears to fix the problem. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.