Method: PidginSpec#initialize
- Defined in:
- lib/pidgin_spec.rb
#initialize(&block) ⇒ PidginSpec
Returns a new instance of PidginSpec.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pidgin_spec.rb', line 8 def initialize(&block) @pass_count = 0 @fail_count = 0 @spec_count = 0 = [] instance_eval(&block) puts "\n#{@spec_count} tests run, #{@fail_count} fail#{"\n\nFailures:\n" if fail_count.nonzero?}".send(@fail_count.zero? ? 'green' : 'red') .each_with_index {|m, index| puts "#{index + 1}. #{m[:description]}\n#{"Wetin make am fail".red}: #{format(m[:failed_code])} \n #{m[:message].red}\n#{m[:failed_code_path].magenta}\n\n" } end |