Search code examples
ruby-on-railsrubyrspecrspec-rails

How to write into Rspec output log file from rspec test case?


I have Rspec test cases but I want write some data from variables into Rspec output file for further processing, so how to write into output file generated by --out rspec_results.html


Solution

  • In your spec_helper.rb file write down this code

    RSpec.configure do |config|
      config.example_status_persistence_file_path = 'spec/examples.txt'
    end