1

When I run bundle exec rspec, I only get reports of failing tests, but no standard output (from something like puts, unlike in this question).

I do not want to test what is printed, I simply want to see it to understand what is going on. Isn't there a flag to simply print this interlined?

xeruf
  • 2,602
  • 1
  • 25
  • 48

2 Answers2

1

Check your logging file, like

tail -f log/test.log
Alter Lagos
  • 12,090
  • 1
  • 70
  • 92
0

As the commend by Stefan said, look for some code that might be redirecting or silencing stdout. I just had the same problem, and turns out my project had this code:

def initialize_print
  @previous_stdout = $stdout
  @previous_stderr = $stderr
  $stdout = StringIO.new
  $stderr = StringIO.new
end

def finalize_print
  unless passed?
    STDOUT.puts $stdout.string if $stdout.string
    STDERR.puts $stderr.string if $stderr.string
  end
  $stdout = @previous_stdout
  $stderr = @previous_stderr
end

And then every test called these in setup/teardown. It was tricky to find because it was defined in various places, and one of them was a gem external to the project, so look for it because it might not be obvious at first glance.