Skip to content
Snippets Groups Projects
Commit 3e5db0cc authored by Arturo Herrero's avatar Arturo Herrero
Browse files

RSpec zero monkey patching mode

The plan for RSpec 4.0 is to disable monkey patching, reference:
https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode
https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode

This commit stops using RSpec monkey patching in several specs.
parent c7dc919c
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 20 deletions
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RepositoryUrlBuilder do
RSpec.describe Gitlab::RepositoryUrlBuilder do
describe '.build' do
using RSpec::Parameterized::TableSyntax
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RequestContext, :request_store do
RSpec.describe Gitlab::RequestContext, :request_store do
subject { described_class.instance }
 
before do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RequestForgeryProtection, :allow_forgery_protection do
RSpec.describe Gitlab::RequestForgeryProtection, :allow_forgery_protection do
let(:csrf_token) { SecureRandom.base64(ActionController::RequestForgeryProtection::AUTHENTICITY_TOKEN_LENGTH) }
let(:env) do
{
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'fast_spec_helper'
 
describe Gitlab::RequestProfiler::Profile do
RSpec.describe Gitlab::RequestProfiler::Profile do
let(:profile) { described_class.new(filename) }
 
describe '.new' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RequestProfiler do
RSpec.describe Gitlab::RequestProfiler do
describe '.profile_token' do
it 'returns a token' do
expect(described_class.profile_token).to be_present
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RouteMap do
RSpec.describe Gitlab::RouteMap do
describe '#initialize' do
context 'when the data is not YAML' do
it 'raises an error' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Routing do
RSpec.describe Gitlab::Routing do
context 'when module is included' do
subject do
Class.new.include(described_class).new
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::RuggedInstrumentation, :request_store do
RSpec.describe Gitlab::RuggedInstrumentation, :request_store do
subject { described_class }
 
describe '.query_time' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Runtime do
RSpec.describe Gitlab::Runtime do
shared_examples "valid runtime" do |runtime, max_threads|
it "identifies itself" do
expect(subject.identify).to eq(runtime)
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::SafeRequestStore do
RSpec.describe Gitlab::SafeRequestStore do
describe '.store' do
context 'when RequestStore is active', :request_store do
it 'uses RequestStore' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Sanitizers::Exif do
RSpec.describe Gitlab::Sanitizers::Exif do
let(:sanitizer) { described_class.new }
 
describe '#batch_clean' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Sanitizers::SVG do
RSpec.describe Gitlab::Sanitizers::SVG do
let(:scrubber) { Gitlab::Sanitizers::SVG::Scrubber.new }
let(:namespace) { double(Nokogiri::XML::Namespace, prefix: 'xlink', href: 'http://www.w3.org/1999/xlink') }
let(:namespaced_attr) { double(Nokogiri::XML::Attr, name: 'href', namespace: namespace, value: '#awesome_id') }
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Search::FoundBlob do
RSpec.describe Gitlab::Search::FoundBlob do
let(:project) { create(:project, :public, :repository) }
 
describe 'parsing content results' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Search::FoundWikiPage do
RSpec.describe Gitlab::Search::FoundWikiPage do
let(:project) { create(:project, :public, :repository) }
 
describe 'policy' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Search::Query do
RSpec.describe Gitlab::Search::Query do
let(:query) { 'base filter:wow anotherfilter:noway name:maybe other:mmm leftover' }
let(:subject) do
described_class.new(query) do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::SearchContext::Builder, type: :controller do
RSpec.describe Gitlab::SearchContext::Builder, type: :controller do
controller(ApplicationController) { }
 
subject(:builder) { described_class.new(controller.view_context) }
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::SearchContext::ControllerConcern, type: :controller do
RSpec.describe Gitlab::SearchContext::ControllerConcern, type: :controller do
controller(ApplicationController) do
include Gitlab::SearchContext::ControllerConcern
end
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::SearchResults do
RSpec.describe Gitlab::SearchResults do
include ProjectForksHelper
include SearchHelpers
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'fast_spec_helper'
 
describe Gitlab::Serializer::Ci::Variables do
RSpec.describe Gitlab::Serializer::Ci::Variables do
subject do
described_class.load(described_class.dump(object))
end
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
require 'spec_helper'
 
describe Gitlab::Serializer::Pagination do
RSpec.describe Gitlab::Serializer::Pagination do
let(:request) { double(url: "#{Gitlab.config.gitlab.url}:8080/api/v4/projects?#{query.to_query}", query_parameters: query) }
let(:response) { spy('response') }
let(:headers) { spy('headers') }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment