Tuesday, 23 February 2016

Rspec formaters

# Add multiple formatters to formater
RSpec.configure do |c|
c.add_formatter(:documentation)
c.add_formatter(:json)
c.add_formatter(:progress)
end
json_formatter = RSpec::Core::Formatters::JsonFormatter.new($stdout)
{"version":"3.4.1","messages":["Run options:\n include {:focus=>true}\n exclude {:slow=>true}"],"examples":[{"description":"should be 200 OK","full_description":"Easybring::APIv1 GET businesses should be 200 OK","status":"passed","file_path":"./spec/endpoints/businesses_spec.rb","line_number":20,"run_time":2.603616,"pending_message":null},{"description":"should be an Array","full_description":"Easybring::APIv1 GET businesses should be an Array","status":"passed","file_path":"./spec/endpoints/businesses_spec.rb","line_number":24,"run_time":0.130511,"pending_message":null}],"summary":{"duration":3.407043,"example_count":2,"failure_count":0,"pending_count":0},"summary_line":"2 examples, 0 failures"}
view raw gistfile1.txt hosted with ❤ by GitHub

No comments:

Post a Comment