Skip to content

Instantly share code, notes, and snippets.

@j1n6
Last active December 10, 2015 17:28
Show Gist options
  • Save j1n6/4467613 to your computer and use it in GitHub Desktop.
Save j1n6/4467613 to your computer and use it in GitHub Desktop.
require 'rspec'
config = RSpec.configuration
# Example 1
# Create a documentation formatter with STDOUT steam
documentation_formatter = RSpec::Core::Formatters::DocumentationFormatter.new($stdout)
documentation_reporter = RSpec::Core::Reporter.new(documentation_formatter)
# Example 2
# Create a JSON formatter with STDOUT steam
json_formatter = RSpec::Core::Formatters::JsonFormatter.new($stdout)
# the reporter can be used later for RSpec configuraiton
json_reporter = RSpec::Core::Reporter.new(json_formatter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment