<commit_before># encoding: utf-8
require 'colorize'

module Spinach
  # Spinach reporter collects information from Runner hooks and outputs the
  # results
  #
  class Reporter

    # Receives this hook when a feature is invoked
    # @param [String] name
    #   the feature name
    #
    def feature(name)
      raise "Abstract method!"
    end

    # Receives this hook when a scenario is invoked
    # @param [String] name
    #   the scenario name
    #
    def scenario(name)
      raise "Abstract method!"
    end

    # Receives this hook when a step is invoked
    # @param [String] name
    #   the scenario name
    # @param [Symbol] result
    #   the step name and its finishing state. May be :success or :failure
    #
    def step(name, result)
      raise "Abstract method!"
    end

    # Receives this hook when a feature reaches its end
    #
    def end
      raise "Abstract method!"
    end

    # The Stdout reporter outputs the runner results to the standard output
    #
    class Stdout < Reporter

      # Prints the feature name to the standard output
      #
      def feature(name)
        puts "\nFeature: #{name}".white.underline
      end

      # Prints the scenario name to the standard ouput
      #
      def scenario(name)
        puts "\n  Scenario: #{name}".white
      end

      # Prints the step name to the standard output. If failed, it puts an
      # F! before
      #
      def step(name, result)
        words = name.split(" ")
        connector = words.shift
        phrase = words.join(" ")
        if result == :success
          puts "    ✔  #{connector} #{phrase}".green
        elsif result == :failure
          puts "    ✘  #{connector} #{phrase}".red<commit_msg>Added new case for step status output<commit_after># encoding: utf-8
require 'colorize'

module Spinach
  # Spinach reporter collects information from Runner hooks and outputs the
  # results
  #
  class Reporter

    # Receives this hook when a feature is invoked
    # @param [String] name
    #   the feature name
    #
    def feature(name)
      raise "Abstract method!"
    end

    # Receives this hook when a scenario is invoked
    # @param [String] name
    #   the scenario name
    #
    def scenario(name)
      raise "Abstract method!"
    end

    # Receives this hook when a step is invoked
    # @param [String] name
    #   the scenario name
    # @param [Symbol] result
    #   the step name and its finishing state. May be :success or :failure
    #
    def step(name, result)
      raise "Abstract method!"
    end

    # Receives this hook when a feature reaches its end
    #
    def end
      raise "Abstract method!"
    end

    # The Stdout reporter outputs the runner results to the standard output
    #
    class Stdout < Reporter

      # Prints the feature name to the standard output
      #
      def feature(name)
        puts "\nFeature: #{name}".white.underline
      end

      # Prints the scenario name to the standard ouput
      #
      def scenario(name)
        puts "\n  Scenario: #{name}".white
      end

      # Prints the step name to the standard output. If failed, it puts an
      # F! before
      #
      def step(name, result)
        words = name.split(" ")
        connector = words.shift
        phrase = words.join(" ")
        if result == :success
          puts "    ✔  #{connector} #{phrase}".green
        elsif result == :failure
          puts "    ✘  #{connector} #{phrase}".red
        elsif result == :undefined_step
          puts "    ?  #{connector} #{phrase}".yellow
{'fraction_non_alphanumeric': 0.08117977528089888, 'fraction_numerical': 0.0005617977528089888, 'mean_word_length': 2.0938314509122504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '735883', 'n_tokens_mistral': 1009, 'n_tokens_neox': 999, 'n_words': 395}