How to configure rspec to output output using spork?

I have spork to speed up my tests, but there is no result when I run them. Is there some kind of configuration that I need to change?

+4
source share
2 answers

Just ran into this while working on spork 1.0.0rc4 and rspec 2.14.1 / rspec-core 2.14.8. As I understand it, the problem lies in the following:

  • Spork sets up $ stdout to point to localhost: port (drb client) so that the entire reporter report is sent to the drb client. This happens after running Spork.prefork.
  • Spork.prefork () RSpec.configure do | config |, ( config.mock_with: rr) , / RSpec.configuration - .
  • RSpec.configuration reset ( @private, ), /, .
  • , - RSpec.configuration.output_stream . , Spork.each_run, , :

    if Spork.using_spork?
        RSpec.configure do |config|
            config.reset
            config.output_stream = $stdout
        end
    end
    

- , !

+6

@astgtciv , , , :

@astgtciv , , . , Spork, DRB .

, attr_accessor :output , Spork.each_run, :

rspec_formatters = RSpec.configuration.formatters

Spork.each_run do
  if Spork.using_spork?
    RSpec.configure do |config|
      config.output_stream = $stdout
    end

    rspec_formatters.each do |formatter|
      if formatter.respond_to?(:output=)
        formatter.output = $stdout
      end
    end
  end
end

, , ( ) . , .

0
source

Source: https://habr.com/ru/post/1530519/


All Articles