class Rsg::Generators::Testing::RspecGenerator

Public Instance Methods

add_rspec() click to toggle source
# File lib/rsg/generators/testing/rspec_generator.rb, line 6
def add_rspec
  append_gem "rspec-rails", within_group: [:development, :test]
end
banner() click to toggle source
enable_recommendations() click to toggle source
# File lib/rsg/generators/testing/rspec_generator.rb, line 18
def enable_recommendations
  gsub_file "spec/spec_helper.rb", /^# The settings below[^=]+=begin\n(.+)\n=end/m, '\1'
end
gitignore() click to toggle source
# File lib/rsg/generators/testing/rspec_generator.rb, line 10
def gitignore
  append_file ".gitignore", "\n# Ignore rspec state\n/spec/examples.txt\n"
end
install() click to toggle source
# File lib/rsg/generators/testing/rspec_generator.rb, line 14
def install
  generate("rspec:install")
end
no_ci_focus() click to toggle source
# File lib/rsg/generators/testing/rspec_generator.rb, line 22
def no_ci_focus
  gsub_file "spec/spec_helper.rb", /^  config\.filter_run_when_matching :focus$/ do
    "  if ENV.key?(\"CI\")\n    config.filter_run_when_matching :focus\n  end"
  end
end