Sha256: 474802b816007c12bda5cc62ebf6e85dbdfa70096790161daa81e0a52a51e02c
Contents?: true
Size: 898 Bytes
Versions: 7
Compression:
Stored size: 898 Bytes
Contents
require 'turnip_formatter/printer' require 'turnip_formatter/printer/step_extra_args' module TurnipFormatter module Printer class Step class << self include TurnipFormatter::Printer def print_out(step) step_templates = TurnipFormatter.step_templates_for(step.status) render_template(:step, { step: step, has_args_or_documents: has_args_or_documents?(step, step_templates), step_docs: documents(step, step_templates) } ) end private def has_args_or_documents?(step, templates) (step.extra_args.length + templates.length) > 0 end def documents(step, templates) templates.map do |template, method| template.send(method, step.example) end.join("\n") end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems