From f2ed64d8552735f7f28521e6e598ad725daacb79 Mon Sep 17 00:00:00 2001 From: David Elner Date: Thu, 14 Dec 2017 13:36:19 -0500 Subject: [PATCH] Added: RSpec test suite initial setup. --- .rspec | 1 + ddtrace.gemspec | 4 +++- spec/spec_helper.rb | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .rspec create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 00000000000..c99d2e7396e --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--require spec_helper diff --git a/ddtrace.gemspec b/ddtrace.gemspec index d7511d6c724..01d1eba8d75 100644 --- a/ddtrace.gemspec +++ b/ddtrace.gemspec @@ -35,7 +35,9 @@ EOS spec.add_dependency 'msgpack' spec.add_development_dependency 'rake', '~> 10.5' - spec.add_development_dependency('rubocop', '= 0.49.1') if RUBY_VERSION >= '2.1.0' + spec.add_development_dependency 'rubocop', '= 0.49.1' if RUBY_VERSION >= '2.1.0' + spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'rspec-collection_matchers', '~> 1.1' spec.add_development_dependency 'minitest', '= 5.10.1' spec.add_development_dependency 'appraisal', '~> 2.2' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 00000000000..ac2359f2822 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,20 @@ +$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'pry' +require 'rspec/collection_matchers' + +require 'ddtrace' + +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.shared_context_metadata_behavior = :apply_to_host_groups + config.disable_monkey_patching! + config.warnings = true + config.order = :random +end