2016-09-22 17:04:35 +00:00
|
|
|
# frozen_string_literal: true
|
2017-05-24 22:11:02 +00:00
|
|
|
|
2015-03-26 13:43:47 +00:00
|
|
|
#
|
|
|
|
# Author:: Enrico Stahn <mail@enricostahn.com>
|
|
|
|
#
|
|
|
|
# Copyright 2014, Zanui, <engineering@zanui.com.au>
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
2015-04-02 09:05:26 +00:00
|
|
|
require "simplecov"
|
|
|
|
require "coveralls"
|
2016-05-19 19:05:18 +00:00
|
|
|
require "vcr"
|
2016-05-20 06:46:13 +00:00
|
|
|
require "webmock/rspec"
|
2015-03-29 18:47:39 +00:00
|
|
|
|
2015-06-10 10:27:27 +00:00
|
|
|
# This module is only used to check the environment is currently a testing env
|
|
|
|
module SpecHelper
|
|
|
|
end
|
|
|
|
|
2016-02-23 21:25:07 +00:00
|
|
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
2016-02-24 13:02:56 +00:00
|
|
|
Coveralls::SimpleCov::Formatter,
|
2017-02-08 20:09:23 +00:00
|
|
|
SimpleCov::Formatter::HTMLFormatter
|
2016-02-24 13:02:56 +00:00
|
|
|
])
|
2016-09-27 19:40:23 +00:00
|
|
|
SimpleCov.start do
|
|
|
|
add_filter "gemfiles/"
|
|
|
|
end
|
2015-03-26 13:43:47 +00:00
|
|
|
|
2015-04-02 09:05:26 +00:00
|
|
|
require "github_changelog_generator"
|
2015-09-15 19:34:54 +00:00
|
|
|
require "github_changelog_generator/task"
|
2015-03-26 13:43:47 +00:00
|
|
|
|
2016-05-19 19:05:18 +00:00
|
|
|
VCR.configure do |c|
|
|
|
|
c.allow_http_connections_when_no_cassette = true
|
2016-05-25 19:46:47 +00:00
|
|
|
c.cassette_library_dir = "spec/vcr"
|
2016-05-19 19:05:18 +00:00
|
|
|
c.ignore_localhost = true
|
2016-05-20 06:46:13 +00:00
|
|
|
c.default_cassette_options = {
|
2016-05-25 19:46:47 +00:00
|
|
|
record: :new_episodes,
|
|
|
|
serialize_with: :json,
|
|
|
|
preserve_exact_body_bytes: true,
|
|
|
|
decode_compressed_response: true
|
2016-05-20 06:46:13 +00:00
|
|
|
}
|
2016-09-27 21:44:49 +00:00
|
|
|
c.filter_sensitive_data("<GITHUB_TOKEN>") do
|
2016-09-27 22:10:51 +00:00
|
|
|
"token #{ENV.fetch('CHANGELOG_GITHUB_TOKEN') { 'frobnitz' }}"
|
2016-09-27 21:44:49 +00:00
|
|
|
end
|
2016-07-02 19:48:08 +00:00
|
|
|
|
2016-07-02 12:44:20 +00:00
|
|
|
c.configure_rspec_metadata!
|
2016-05-20 06:46:13 +00:00
|
|
|
|
|
|
|
c.hook_into :webmock, :faraday
|
2016-05-19 19:05:18 +00:00
|
|
|
end
|
|
|
|
|
2015-03-26 09:48:06 +00:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.expect_with :rspec do |expectations|
|
|
|
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
|
|
end
|
|
|
|
|
|
|
|
config.mock_with :rspec do |mocks|
|
|
|
|
mocks.verify_partial_doubles = true
|
|
|
|
end
|
|
|
|
|
|
|
|
config.filter_run :focus
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
|
|
|
config.warnings = true
|
|
|
|
|
2015-09-16 11:50:21 +00:00
|
|
|
config.default_formatter = "doc" if config.files_to_run.one?
|
2015-03-26 09:48:06 +00:00
|
|
|
|
|
|
|
config.order = :random
|
|
|
|
|
|
|
|
Kernel.srand config.seed
|
|
|
|
end
|