Ruby online editor is missing "YOUR OUTPUT" section for debug statements

I attempted to use the “debug” feature today as I was working on a Ruby exercise, but could not find where the output is written. According to this forum post, there is supposed to be a YOUR OUTPUT section in the Results tab. However, I do not have a YOUR OUTPUT section.

I’ve checked that this happens in both Firefox and Chrome, in incognito mode, on multiple Ruby exercises (specifically, I’ve checked on Log line Parser, Two Bucket, and Lasagna).

As far as I can tell, the debug functionality described in Ruby exercises’ “How to debug” section (at the bottom of the Instructions tab) is not working.

I’m happy to provide more details, try things, etc. if folks can’t replicate this.

This output is unlikely to be affected by browser choice.

This is the basics (lasagna) code I tested this with:

class Lasagna
  EXPECTED_MINUTES_IN_OVEN = 40
  
  def remaining_minutes_in_oven(actual_minutes_in_oven)
    debug "The input is #{actual_minutes_in_oven.inspect}"

    EXPECTED_MINUTES_IN_OVEN - actual_minutes_in_oven
  end

  def preparation_time_in_minutes(layers)
    debug "The value is #{layers}."
    
    layers * 2
  end

  def total_time_in_minutes(number_of_layers:, actual_minutes_in_oven:)
    preparation_time_in_minutes(number_of_layers) + actual_minutes_in_oven
  end
end

Can you:

  1. try out this example
  2. show us in a codeblock what code you’re trying to use debug with?
```ruby
# your code here
```
1 Like

Ah, okay, I misunderstood/was wrong about all this, and you got me to think about it correctly (I think). I can indeed see my debug text when I add it within the relevant methods.

What originally threw me off was that I was getting errors in my Two Bucket problem that failed to get me to the individual test results section. E.g., this one:

Even when I have a debug statement in my code before that error line is run, I cannot see my debug statement anywhere – so I was thinking it was broken. To check the other exercises, I (foolishly) just opened them up real quick and added a debug line as the first line in the class (i.e., not within a function that any of the tests would be calling). I was thinking that if I just solely had this for my Two Bucket code that I should see that debug line somewhere (while expected to fail all the tests, obviously):

class TwoBucket
  debug "test debug"
end

It now makes sense to me why that’s not the case. Thank you. I think all is well.

1 Like

Have fun! and enjoy!

1 Like