Setting up/ Configuring Flashcards
1
Q
How do you configure Shoulda Matchers gem?
A
Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end
2
Q
How do you set up RSpec for your Rails app?
A
- add ‘rspec-rails’ in gemfile
- run in terminal: rails g rspec:install
- in rspec file:
- -require spec_helper
- -format documentation
- -color
3
Q
How do you set up Cucumber for your Rails app?
A
- add gem in gemfile
2. run in terminal: rails g cucumber:install
4
Q
How do you set up coveralls from your Rails app?
A
- add ‘coveralls’ gem in gemfile
- make a file in lib tasks called ci.rake
- Add the following code:
unless Rails.env.production?
require ‘rspec/core/rake_task’
require ‘coveralls/rake/task’Coveralls::RakeTask.newnamespace :ci do
task tests: [:spec, ‘coveralls:push’]
end
end
4. Add the following to the very top of spec_helper:
require ‘coveralls’
Coveralls.wear_merged!(‘rails’)