From d2322fb8455c63681908406d2ab48c59ec4886e8 Mon Sep 17 00:00:00 2001 From: pex Date: Mon, 15 Sep 2014 22:12:10 +0200 Subject: [PATCH] Update RSpec --- .rspec | 1 + spec/rack/reverse_proxy_spec.rb | 3 +-- spec/spec.opts | 2 -- spec/spec_helper.rb | 23 ++++++++++++++++++----- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 .rspec delete mode 100644 spec/spec.opts diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..4e1e0d2 --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--color diff --git a/spec/rack/reverse_proxy_spec.rb b/spec/rack/reverse_proxy_spec.rb index 2c7cdde..411bd88 100644 --- a/spec/rack/reverse_proxy_spec.rb +++ b/spec/rack/reverse_proxy_spec.rb @@ -1,8 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') -describe Rack::ReverseProxy do +RSpec.describe Rack::ReverseProxy do include Rack::Test::Methods - include WebMock::API def app Rack::ReverseProxy.new diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index 27ec799..0000000 --- a/spec/spec.opts +++ /dev/null @@ -1,2 +0,0 @@ ---color ---format specdoc diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e632b72..1c3a928 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,24 @@ -require 'rack/reverse_proxy' -require 'spec' -require 'spec/autorun' require 'rubygems' +require 'rack/reverse_proxy' +require 'rspec' require 'rack/test' -require 'webmock' require 'webmock/rspec' -Spec::Runner.configure do |config| +RSpec.configure do |config| + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + expectations.syntax = [:should] + end + config.mock_with :rspec do |mocks| + mocks.verify_doubled_constant_names = true + mocks.verify_partial_doubles = true + mocks.syntax = [:should] + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + WebMock.disable_net_connect! end