Skip to content

Commit

Permalink
Use simplecov for C0 coverage
Browse files Browse the repository at this point in the history
* Include simplecov gem in Gemfile, test group
* Insert simplecov init into spec_helper.rb, env.rb
  • Loading branch information
jferris committed Oct 22, 2012
1 parent 52444eb commit 44c51c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/suspenders/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions templates/Gemfile_additions
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ group :test do
gem 'timecop'
gem 'shoulda-matchers'
gem 'launchy'
gem 'simplecov', require: false
end

group :staging, :production do
Expand Down

0 comments on commit 44c51c1

Please sign in to comment.