Skip to content

Commit 8d37d63

Browse files
committed
Installing RSpec and SimpleCov
1 parent 01e3beb commit 8d37d63

File tree

2 files changed

+103
-1
lines changed

2 files changed

+103
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ log
1111
features/settings.yml
1212
*.gem
1313
.tags
14-
.tags_sorted_by_file
14+
.tags_sorted_by_file
15+
coverage

spec/spec_helper.rb

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
require 'simplecov'
2+
SimpleCov.start
3+
4+
require 'bitbucket_rest_api'
5+
6+
# This file was generated by the `rspec --init` command. Conventionally, all
7+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
8+
# The generated `.rspec` file contains `--require spec_helper` which will cause
9+
# this file to always be loaded, without a need to explicitly require it in any
10+
# files.
11+
#
12+
# Given that it is always loaded, you are encouraged to keep this file as
13+
# light-weight as possible. Requiring heavyweight dependencies from this file
14+
# will add to the boot time of your test suite on EVERY test run, even for an
15+
# individual file that may not need all of that loaded. Instead, consider making
16+
# a separate helper file that requires the additional dependencies and performs
17+
# the additional setup, and require it from the spec files that actually need
18+
# it.
19+
#
20+
# The `.rspec` file also contains a few flags that are not defaults but that
21+
# users commonly want.
22+
#
23+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
24+
RSpec.configure do |config|
25+
# rspec-expectations config goes here. You can use an alternate
26+
# assertion/expectation library such as wrong or the stdlib/minitest
27+
# assertions if you prefer.
28+
config.expect_with :rspec do |expectations|
29+
# This option will default to `true` in RSpec 4. It makes the `description`
30+
# and `failure_message` of custom matchers include text for helper methods
31+
# defined using `chain`, e.g.:
32+
# be_bigger_than(2).and_smaller_than(4).description
33+
# # => "be bigger than 2 and smaller than 4"
34+
# ...rather than:
35+
# # => "be bigger than 2"
36+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
37+
end
38+
39+
# rspec-mocks config goes here. You can use an alternate test double
40+
# library (such as bogus or mocha) by changing the `mock_with` option here.
41+
config.mock_with :rspec do |mocks|
42+
# Prevents you from mocking or stubbing a method that does not exist on
43+
# a real object. This is generally recommended, and will default to
44+
# `true` in RSpec 4.
45+
mocks.verify_partial_doubles = true
46+
end
47+
48+
# The settings below are suggested to provide a good initial experience
49+
# with RSpec, but feel free to customize to your heart's content.
50+
=begin
51+
# These two settings work together to allow you to limit a spec run
52+
# to individual examples or groups you care about by tagging them with
53+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
54+
# get run.
55+
config.filter_run :focus
56+
config.run_all_when_everything_filtered = true
57+
58+
# Allows RSpec to persist some state between runs in order to support
59+
# the `--only-failures` and `--next-failure` CLI options. We recommend
60+
# you configure your source control system to ignore this file.
61+
config.example_status_persistence_file_path = "spec/examples.txt"
62+
63+
# Limits the available syntax to the non-monkey patched syntax that is
64+
# recommended. For more details, see:
65+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
66+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
67+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
68+
config.disable_monkey_patching!
69+
70+
# This setting enables warnings. It's recommended, but in some cases may
71+
# be too noisy due to issues in dependencies.
72+
config.warnings = true
73+
74+
# Many RSpec users commonly either run the entire suite or an individual
75+
# file, and it's useful to allow more verbose output when running an
76+
# individual spec file.
77+
if config.files_to_run.one?
78+
# Use the documentation formatter for detailed output,
79+
# unless a formatter has already been configured
80+
# (e.g. via a command-line flag).
81+
config.default_formatter = 'doc'
82+
end
83+
84+
# Print the 10 slowest examples and example groups at the
85+
# end of the spec run, to help surface which specs are running
86+
# particularly slow.
87+
config.profile_examples = 10
88+
89+
# Run specs in random order to surface order dependencies. If you find an
90+
# order dependency and want to debug it, you can fix the order by providing
91+
# the seed, which is printed after each run.
92+
# --seed 1234
93+
config.order = :random
94+
95+
# Seed global randomization in this process using the `--seed` CLI option.
96+
# Setting this allows you to use `--seed` to deterministically reproduce
97+
# test failures related to randomization by passing the same `--seed` value
98+
# as the one that triggered the failure.
99+
Kernel.srand config.seed
100+
=end
101+
end

0 commit comments

Comments
 (0)