jendiamond / railsgirls-signup

https://railsgirls-signup.herokuapp.com
3 stars 3 forks source link

Add RSpec & SimpleCov & Pry #6

Closed jendiamond closed 8 years ago

jendiamond commented 8 years ago

Pull request https://github.com/jendiamond/railsgirls-signup/pull/7

SimpleCov

https://rubygems.org/gems/simplecov/versions/0.12.0 https://github.com/colszowka/simplecov

RSpec-Rails

https://github.com/rspec/rspec-rails https://rubygems.org/gems/rspec-rails/versions/3.5.1

Pry

https://rubygems.org/gems/pry http://pryrepl.org/


Add this to the Gemfile

group :development, :test do
  gem 'byebug', platform: :mri
  gem 'pry', '~> 0.10.4'
  gem 'rspec-rails', '~> 3.5', '>= 3.5.1'
  gem 'simplecov', '~> 0.12.0', :require => false
end

Run $ bundle install

RSpec-Rails

$ rails generate rspec:install

This will create a spec directory and a .rspec file

      create  .rspec
      create  spec
      create  spec/spec_helper.rb
      create  spec/rails_helper.rb

SimpleCov

Load and launch SimpleCov at the very top of your **spec/spec_helper.rb**

require 'simplecov'
SimpleCov.start 'rails'

Add the following to your .gitignore file to ensure that coverage results are not tracked by Git (optional):

coverage


Run your tests

$ rspec spec

Open up the file coverage/index.html in your browser and check out what tests are covered and what you've missed so far.

file:///home/jendiamond/Desktop/groundwork/railsgirls-signup/coverage/index.html#_AllFiles