Skip to content

Commit 5d91b4a

Browse files
committed
Get the last line of @output_buffer regardless of how many elements are in it
1 parent 1f9a01b commit 5d91b4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/try_ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def show_result(retval)
397397
# Do not check the answer if there is no regexp matcher
398398
if @current_item && @current_item.answer
399399
# Get last line of output
400-
value_to_check = @output_buffer.length > 0 && !@output_buffer.last.empty? ? @output_buffer.last.chomp : ''
400+
value_to_check = @output_buffer.join.rstrip.lines.last
401401

402402
# Check if output matches the defined answer regexp
403403
# and print status message

0 commit comments

Comments
 (0)