ander
rspec setup made easy for rails!
Included gems
- 'rspec'
- 'rspec-rails'
- 'simplecov'
Install
gem install ander
Requirements
- Ruby 1.9.3 or higher
##What ander do
- Sets up rspec, rspec-rails and simplecov for your rails project
##What ander exactly do
- Adds rspec, rspec-rails and simplecov to your Gemfile
- Executes bundle install
- Executes rails generate rspec:install
- Configures .rspec file to include html format output
- Configures spec_helper.rb file for simplecov and rspec-rails
- Adds sample_spec.rb file which shows how to write unit-tests with rspec
##How to use ander
- Add ander to your Gemfile
- Bundle install
- Run Ander.setup_all in your rails console
##Content of included Sample file
require 'rails_helper'
RSpec.describe 'Target Object' do
before(:all) do
# 'This gets executed before all test cases in current script'
end
before(:each) do
# 'This gets executed before each test cases in current script'
end
after(:all) do
# 'This gets executed after all test cases in current script'
end
after(:each) do
# 'This gets executed after each test cases in current script'
end
describe 'Title of test case:' do
context 'Context of your test case' do
let(:x) {
x = 'This gets executed upon calling for x'
}
it 'Expected result of your test case' do
expect(x).to eq('This gets executed upon calling for x')
end
end
end
end