Method: Spinach::Reporter::Stdout#on_feature_not_found

Defined in:
lib/spinach/reporter/stdout.rb

#on_feature_not_found(feature) ⇒ Object

Adds a feature not found message to the output buffer.

Parameters:

  • feature (Hash)

    the feature in a json gherkin format

  • exception (Spinach::FeatureNotFoundException)

    the related exception



129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/spinach/reporter/stdout.rb', line 129

def on_feature_not_found(feature)
  generator = Generators::FeatureGenerator.new(feature)
  lines = "Could not find steps for `#{feature.name}` feature\n\n"
  lines << "\nPlease create the file #{generator.filename} at #{generator.path}, with:\n\n"

  lines << generator.generate

  lines.split("\n").each do |line|
    out.puts "    #{line}".red
  end
  out.puts "\n\n"

  undefined_features << feature
end