- cd into new directory
gem install bundler
bundle init
to create new Gemfile
- Add the following to Gemfile:
gem 'rake'
gem 'rubocop', '0.56.0'
group :test do
gem 'rspec'
gem 'simplecov', require: false
gem 'simplecov-console', require: false
gem "guard"
gem 'guard-rspec', require: false
end
bundle install
rspec --init
to create RSpec helper and file structure
guard init
to setup guard file
guard init rspec
to setup guard file with rspec
mkdir lib
- add the following to the top of spec helper
require 'simplecov'
require 'simplecov-console'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::Console,
# Want a nice code coverage website? Uncomment this next line!
# SimpleCov::Formatter::HTMLFormatter
])
SimpleCov.start
- create a
Rakefile
and paste in the following:
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new :spec
task default: [:spec]
- add the following line to
.rspec
:
--color --format documentation