Skip to content

Instantly share code, notes, and snippets.

Avatar

Sarah Vessels cheshire137

  • GitHub Staff
  • Nashville, Tennessee
  • 19:43 (UTC -06:00)
View GitHub Profile
View missing_spec_generator.rb
require 'erb'
# lib/missing_spec_generator.rb
class MissingSpecGenerator
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
def spec_file spec_path, file_name, spec_template, namespace
spec_name = file_name.gsub('.rb', '') + '_spec.rb'
if File.exist?("#{spec_path}/#{spec_name}")
puts "#{spec_path}/#{spec_name} exists"