diff --git a/rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb b/rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb index c14b8851..433e6ea5 100644 --- a/rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb +++ b/rack-protection/spec/lib/rack/protection/authenticity_token_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::AuthenticityToken do +RSpec.describe Rack::Protection::AuthenticityToken do let(:token) { described_class.random_token } let(:masked_token) { described_class.token(session) } let(:bad_token) { Base64.strict_encode64("badtoken") } diff --git a/rack-protection/spec/lib/rack/protection/base_spec.rb b/rack-protection/spec/lib/rack/protection/base_spec.rb index 72778642..46a4d901 100644 --- a/rack-protection/spec/lib/rack/protection/base_spec.rb +++ b/rack-protection/spec/lib/rack/protection/base_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::Base do +RSpec.describe Rack::Protection::Base do subject { described_class.new(lambda {}) } diff --git a/rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb b/rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb index 547bb4a7..0df46ba8 100644 --- a/rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb +++ b/rack-protection/spec/lib/rack/protection/content_security_policy_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::ContentSecurityPolicy do +RSpec.describe Rack::Protection::ContentSecurityPolicy do it_behaves_like "any rack application" it 'should set the Content Security Policy' do diff --git a/rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb b/rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb index f973bd47..af6d8882 100644 --- a/rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb +++ b/rack-protection/spec/lib/rack/protection/cookie_tossing_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::CookieTossing do +RSpec.describe Rack::Protection::CookieTossing do it_behaves_like "any rack application" context 'with default reaction' do diff --git a/rack-protection/spec/lib/rack/protection/escaped_params_spec.rb b/rack-protection/spec/lib/rack/protection/escaped_params_spec.rb index 4134dc6e..01c4f3a6 100644 --- a/rack-protection/spec/lib/rack/protection/escaped_params_spec.rb +++ b/rack-protection/spec/lib/rack/protection/escaped_params_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::EscapedParams do +RSpec.describe Rack::Protection::EscapedParams do it_behaves_like "any rack application" context 'escaping' do diff --git a/rack-protection/spec/lib/rack/protection/form_token_spec.rb b/rack-protection/spec/lib/rack/protection/form_token_spec.rb index e799ed8e..b9a340da 100644 --- a/rack-protection/spec/lib/rack/protection/form_token_spec.rb +++ b/rack-protection/spec/lib/rack/protection/form_token_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::FormToken do +RSpec.describe Rack::Protection::FormToken do let(:token) { described_class.random_token } let(:masked_token) { described_class.token(session) } let(:bad_token) { Base64.strict_encode64("badtoken") } diff --git a/rack-protection/spec/lib/rack/protection/frame_options_spec.rb b/rack-protection/spec/lib/rack/protection/frame_options_spec.rb index 1be4335e..367bf364 100644 --- a/rack-protection/spec/lib/rack/protection/frame_options_spec.rb +++ b/rack-protection/spec/lib/rack/protection/frame_options_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::FrameOptions do +RSpec.describe Rack::Protection::FrameOptions do it_behaves_like "any rack application" it 'should set the X-Frame-Options' do diff --git a/rack-protection/spec/lib/rack/protection/http_origin_spec.rb b/rack-protection/spec/lib/rack/protection/http_origin_spec.rb index a6b0239e..fd6bbedf 100644 --- a/rack-protection/spec/lib/rack/protection/http_origin_spec.rb +++ b/rack-protection/spec/lib/rack/protection/http_origin_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::HttpOrigin do +RSpec.describe Rack::Protection::HttpOrigin do it_behaves_like "any rack application" before(:each) do diff --git a/rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb b/rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb index a75aae52..b3a91094 100644 --- a/rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb +++ b/rack-protection/spec/lib/rack/protection/ip_spoofing_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::IPSpoofing do +RSpec.describe Rack::Protection::IPSpoofing do it_behaves_like "any rack application" it 'accepts requests without X-Forward-For header' do diff --git a/rack-protection/spec/lib/rack/protection/json_csrf_spec.rb b/rack-protection/spec/lib/rack/protection/json_csrf_spec.rb index 77ff258b..fb45b840 100644 --- a/rack-protection/spec/lib/rack/protection/json_csrf_spec.rb +++ b/rack-protection/spec/lib/rack/protection/json_csrf_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::JsonCsrf do +RSpec.describe Rack::Protection::JsonCsrf do it_behaves_like "any rack application" module DummyAppWithBody diff --git a/rack-protection/spec/lib/rack/protection/path_traversal_spec.rb b/rack-protection/spec/lib/rack/protection/path_traversal_spec.rb index 0e191cf2..fba876d9 100644 --- a/rack-protection/spec/lib/rack/protection/path_traversal_spec.rb +++ b/rack-protection/spec/lib/rack/protection/path_traversal_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::PathTraversal do +RSpec.describe Rack::Protection::PathTraversal do it_behaves_like "any rack application" context 'escaping' do diff --git a/rack-protection/spec/lib/rack/protection/protection_spec.rb b/rack-protection/spec/lib/rack/protection/protection_spec.rb index 815fab8e..9bdb34e0 100644 --- a/rack-protection/spec/lib/rack/protection/protection_spec.rb +++ b/rack-protection/spec/lib/rack/protection/protection_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection do +RSpec.describe Rack::Protection do it_behaves_like "any rack application" it 'passes on options' do diff --git a/rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb b/rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb index e67d0813..35512b9d 100644 --- a/rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb +++ b/rack-protection/spec/lib/rack/protection/remote_referrer_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::RemoteReferrer do +RSpec.describe Rack::Protection::RemoteReferrer do it_behaves_like "any rack application" it "accepts post requests with no referrer" do diff --git a/rack-protection/spec/lib/rack/protection/remote_token_spec.rb b/rack-protection/spec/lib/rack/protection/remote_token_spec.rb index 9ef4a03b..bc04f1ad 100644 --- a/rack-protection/spec/lib/rack/protection/remote_token_spec.rb +++ b/rack-protection/spec/lib/rack/protection/remote_token_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::RemoteToken do +RSpec.describe Rack::Protection::RemoteToken do let(:token) { described_class.random_token } let(:masked_token) { described_class.token(session) } let(:bad_token) { Base64.strict_encode64("badtoken") } diff --git a/rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb b/rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb index 11d655c5..0a96c230 100644 --- a/rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb +++ b/rack-protection/spec/lib/rack/protection/session_hijacking_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::SessionHijacking do +RSpec.describe Rack::Protection::SessionHijacking do it_behaves_like "any rack application" it "accepts a session without changes to tracked parameters" do diff --git a/rack-protection/spec/lib/rack/protection/strict_transport_spec.rb b/rack-protection/spec/lib/rack/protection/strict_transport_spec.rb index cd1262a0..21cba97a 100644 --- a/rack-protection/spec/lib/rack/protection/strict_transport_spec.rb +++ b/rack-protection/spec/lib/rack/protection/strict_transport_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::StrictTransport do +RSpec.describe Rack::Protection::StrictTransport do it_behaves_like "any rack application" it 'should set the Strict-Transport-Security header' do diff --git a/rack-protection/spec/lib/rack/protection/xss_header_spec.rb b/rack-protection/spec/lib/rack/protection/xss_header_spec.rb index 37a7af31..1b5d3c03 100644 --- a/rack-protection/spec/lib/rack/protection/xss_header_spec.rb +++ b/rack-protection/spec/lib/rack/protection/xss_header_spec.rb @@ -1,4 +1,4 @@ -describe Rack::Protection::XSSHeader do +RSpec.describe Rack::Protection::XSSHeader do it_behaves_like "any rack application" it 'should set the X-XSS-Protection' do diff --git a/rack-protection/spec/spec_helper.rb b/rack-protection/spec/spec_helper.rb index 8928f787..745c2f9f 100644 --- a/rack-protection/spec/spec_helper.rb +++ b/rack-protection/spec/spec_helper.rb @@ -21,8 +21,9 @@ Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f } # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. + config.disable_monkey_patching! # These two settings work together to allow you to limit a spec run # to individual examples or groups you care about by tagging them with diff --git a/rack-protection/spec/support/shared_examples.rb b/rack-protection/spec/support/shared_examples.rb index ddf68ff5..6e56cdb8 100644 --- a/rack-protection/spec/support/shared_examples.rb +++ b/rack-protection/spec/support/shared_examples.rb @@ -1,4 +1,4 @@ -shared_examples_for 'any rack application' do +RSpec.shared_examples_for 'any rack application' do it "should not interfere with normal get requests" do expect(get('/')).to be_ok expect(body).to eq('ok')