Note that there are some explanatory texts on larger screens.

plurals
  1. POCucumber colored output changes depending on where I print text
    primarykey
    data
    text
    <p>When I print output straight from the Given/When/Then statements of cucumber, it prints in a nice blue text, however if I call into any other function and print within there, it prints in red (and not indented)</p> <p>Sample feature:</p> <pre><code>Feature: Foo Scenario: Foo2 Given something Then something else </code></pre> <p>Sample step_def:</p> <pre><code>Given /^something$/ do puts "Pretty blue" end class AnyClass def doSomething puts "Scary red" end end Then /^something else$/ do AnyClass.new.doSomething end </code></pre> <p>In the below sample output, "Scary red" is red, not indented at all, and actually printed before the cucumber step (The "Then" clause). "Pretty blue" is blue, indented appropriately, and outputted after the cucumber step.</p> <pre><code>Feature: Foo Scenario: Foo2 Given something Pretty blue Scary red Then something else 1 scenario (1 passed) 2 steps (2 passed) 0m0.001s </code></pre> <p>I am new to Ruby &amp; cucumber so I am not even positive those are the appropriate tags for this question. Is there a way to make output from methods called within other classes will match the pretty formatting?</p> <p>Edit: Some more searching has shown that puts from within steps are handled differently (as in, if you format it differently, they are included) than puts from other functions (which get excluded from other formatters). So perhaps the question is, how does Ruby intercept the puts from the steps? I suspect they're implementing their own puts which is part of the step's class then.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload