Sha256: d4ba06c0776d8abd234d96b80f46620506e3f74fe3f3bf96b786442cc9de6fd7
Contents?: true
Size: 1.45 KB
Versions: 7
Compression:
Stored size: 1.45 KB
Contents
require 'turnip_formatter/version' require 'turnip' require 'turnip_formatter/renderer/html' module TurnipFormatter class << self attr_accessor :title def step_templates @step_templates ||= [] end def step_templates_for(status) step_templates.reduce([]) do |templates, t| hooks = t.class.hooks return templates unless hooks.key?(status) templates + [t].product(hooks[status]) end end def add_stylesheet(stylesheets) stylesheets = [stylesheets] if stylesheets.is_a? String stylesheets.each do |s| TurnipFormatter::Renderer::Html.add_stylesheet(s) end end def add_javascript(scripts) scripts = [scripts] if scripts.is_a? String scripts.each do |s| TurnipFormatter::Renderer::Html.add_javascript(s) end end def configure yield self end def configuration self end end require 'rspec/core/formatters/turnip_formatter' require 'turnip_formatter/step_template/exception' require 'turnip_formatter/ext/turnip/rspec' end RSpecTurnipFormatter = RSpec::Core::Formatters::TurnipFormatter TurnipFormatter.configure do |config| config.title = 'Turnip' end (File.dirname(__FILE__) + '/turnip_formatter/renderer/html/assets').tap do |dirname| TurnipFormatter::Renderer::Html.add_stylesheet(dirname + '/turnip_formatter.css') TurnipFormatter::Renderer::Html.add_javascript(dirname + '/turnip_formatter.js') end
Version data entries
7 entries across 7 versions & 1 rubygems