Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use simplecov for C0 coverage

* Include simplecov gem in Gemfile, test group
* Insert simplecov init into spec_helper.rb, env.rb
  • Loading branch information...
commit 44c51c1a87f68f884e54083bfdc127c14298ddea 1 parent 52444eb
@jferris jferris authored
Showing with 19 additions and 0 deletions.
  1. +18 −0 lib/suspenders/app_builder.rb
  2. +1 −0  templates/Gemfile_additions
View
18 lib/suspenders/app_builder.rb
@@ -2,6 +2,8 @@ module Suspenders
class AppBuilder < Rails::AppBuilder
include Suspenders::Actions
+ SIMPLECOV_INIT = %{require 'simplecov'\nSimpleCov.start 'rails'\n\n}
+
def readme
template 'README.md.erb', 'README.md'
end
@@ -136,6 +138,7 @@ def configure_action_mailer
def generate_rspec
generate 'rspec:install'
inject_into_file '.rspec', " --drb", :after => '--color'
+ prepend_file 'spec/spec_helper.rb', SIMPLECOV_INIT
replace_in_file 'spec/spec_helper.rb',
'# config.mock_with :mocha', 'config.mock_with :mocha'
end
@@ -146,6 +149,21 @@ def configure_capybara_webkit
end
end
+ def generate_cucumber(options = {})
+ generate 'cucumber:install', '--rspec', '--capybara'
+ inject_into_file 'config/cucumber.yml',
+ ' -drb -r features', :after => %{default: <%= std_opts %> features}
+ copy_file 'features_support_env.rb', 'features/support/env.rb',
+ :force => true
+
+ prepend_file 'features/support/env.rb', SIMPLECOV_INIT
+ if options[:webkit]
+ inject_into_file 'features/support/env.rb',
+ "\n Capybara.javascript_driver = :webkit",
+ :after => /Capybara.default_selector = :css/
+ end
+ end
+
def setup_guard_spork
copy_file 'Guardfile', 'Guardfile'
end
View
1  templates/Gemfile_additions
@@ -25,6 +25,7 @@ group :test do
gem 'timecop'
gem 'shoulda-matchers'
gem 'launchy'
+ gem 'simplecov', require: false
end
group :staging, :production do
Please sign in to comment.
Something went wrong with that request. Please try again.