Created
July 24, 2014 08:40
-
-
Save rummelonp/64a0d94b0d25905b30a9 to your computer and use it in GitHub Desktop.
RSpec 3 用の spec_helper.rb の雛形的な
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--color | |
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe MyBeautifulGem do | |
# テストとか書く | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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