Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created July 24, 2014 08:40
Show Gist options
  • Save rummelonp/64a0d94b0d25905b30a9 to your computer and use it in GitHub Desktop.
Save rummelonp/64a0d94b0d25905b30a9 to your computer and use it in GitHub Desktop.
RSpec 3 用の spec_helper.rb の雛形的な
--color
--require spec_helper
describe MyBeautifulGem do
# テストとか書く
end
# coding: utf-8
require 'my_beautiful_gem'
require 'rspec'
RSpec.configure do |config|
# focus: true が設定された example がある時それの example だけを実行する
config.filter_run :focus
# focus: true が設定された example がない時全ての example を実行する
config.run_all_when_everything_filtered = true
# テストをランダムな順序で実行する
config.order = :random
# expect 記法を強制する
config.expect_with :rspec do |expectations|
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment