1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Disable monkey patch in RSpec for sinatra-contrib

This commit is contained in:
Eloy Pérez 2022-02-05 13:27:48 +01:00
parent c922ffe2bc
commit 5f95f553ab
16 changed files with 19 additions and 18 deletions

View file

@ -2,7 +2,7 @@
require 'slim'
require 'spec_helper'
describe Sinatra::Capture do
RSpec.describe Sinatra::Capture do
subject do
Sinatra.new do
enable :inline_templates

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::ConfigFile do
RSpec.describe Sinatra::ConfigFile do
def config_file(*args, &block)
mock_app do
register Sinatra::ConfigFile

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::ContentFor do
RSpec.describe Sinatra::ContentFor do
subject do
Sinatra.new do
helpers Sinatra::ContentFor

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::Cookies do
RSpec.describe Sinatra::Cookies do
def cookie_route(*cookies, &block)
result = nil
set_cookie(cookies)

View file

@ -1,7 +1,7 @@
require 'spec_helper'
require 'sinatra/custom_logger'
describe Sinatra::CustomLogger do
RSpec.describe Sinatra::CustomLogger do
before do
rack_logger = @rack_logger = double
mock_app do

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::Extension do
RSpec.describe Sinatra::Extension do
module ExampleExtension
extend Sinatra::Extension

View file

@ -3,7 +3,7 @@ require 'multi_json'
require 'spec_helper'
require 'okjson'
shared_examples_for "a json encoder" do |lib, const|
RSpec.shared_examples_for "a json encoder" do |lib, const|
before do
begin
require lib if lib
@ -29,7 +29,7 @@ shared_examples_for "a json encoder" do |lib, const|
end
end
describe Sinatra::JSON do
RSpec.describe Sinatra::JSON do
def mock_app(&block)
super do
class_eval(&block)

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::LinkHeader do
RSpec.describe Sinatra::LinkHeader do
before do
mock_app do
helpers Sinatra::LinkHeader

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::MultiRoute do
RSpec.describe Sinatra::MultiRoute do
it 'does not break normal routing' do
mock_app do

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::Namespace do
RSpec.describe Sinatra::Namespace do
verbs = [:get, :head, :post, :put, :delete, :options, :patch]
def mock_app(&block)

View file

@ -2,7 +2,7 @@ require 'spec_helper'
require 'sinatra/quiet_logger'
require 'logger'
describe Sinatra::QuietLogger do
RSpec.describe Sinatra::QuietLogger do
it 'logs just paths not excluded' do
log = StringIO.new

View file

@ -1,7 +1,7 @@
require 'spec_helper'
require 'fileutils'
describe Sinatra::Reloader do
RSpec.describe Sinatra::Reloader do
# Returns the temporary directory.
def tmp_dir
File.expand_path('../tmp', __dir__)

View file

@ -1,6 +1,6 @@
require_relative 'spec_helper'
describe Sinatra::RequiredParams do
RSpec.describe Sinatra::RequiredParams do
context "#required_params" do
context "simple keys" do
before do

View file

@ -3,7 +3,7 @@ require 'multi_json'
require 'spec_helper'
require 'okjson'
describe Sinatra::RespondWith do
RSpec.describe Sinatra::RespondWith do
def respond_app(&block)
mock_app do
set :app_file, __FILE__

View file

@ -18,8 +18,9 @@ require 'sinatra/contrib'
#
# 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

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe Sinatra::Streaming do
RSpec.describe Sinatra::Streaming do
def stream(&block)
rack_middleware = @use
out = nil