diff options
Diffstat (limited to 'spec/lib/gitlab')
166 files changed, 244 insertions, 244 deletions
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb index 43d52b941ab..f668f78c2b8 100644 --- a/spec/lib/gitlab/asciidoc_spec.rb +++ b/spec/lib/gitlab/asciidoc_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' require 'nokogiri' module Gitlab - describe Asciidoc, lib: true do + describe Asciidoc do let(:input) { '<b>ascii</b>' } let(:context) { {} } let(:html) { 'H<sub>2</sub>O' } diff --git a/spec/lib/gitlab/auth/unique_ips_limiter_spec.rb b/spec/lib/gitlab/auth/unique_ips_limiter_spec.rb index 15b3db0ed3d..f29431b937c 100644 --- a/spec/lib/gitlab/auth/unique_ips_limiter_spec.rb +++ b/spec/lib/gitlab/auth/unique_ips_limiter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Auth::UniqueIpsLimiter, :clean_gitlab_redis_shared_state, lib: true do +describe Gitlab::Auth::UniqueIpsLimiter, :clean_gitlab_redis_shared_state do include_context 'unique ips sign in limit' let(:user) { create(:user) } diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb index 55780518230..a9db0d5164d 100644 --- a/spec/lib/gitlab/auth_spec.rb +++ b/spec/lib/gitlab/auth_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Auth, lib: true do +describe Gitlab::Auth do let(:gl_auth) { described_class } describe 'constants' do diff --git a/spec/lib/gitlab/backup/manager_spec.rb b/spec/lib/gitlab/backup/manager_spec.rb index 8536d152272..8772d3d5ada 100644 --- a/spec/lib/gitlab/backup/manager_spec.rb +++ b/spec/lib/gitlab/backup/manager_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Backup::Manager, lib: true do +describe Backup::Manager do include StubENV let(:progress) { StringIO.new } diff --git a/spec/lib/gitlab/backup/repository_spec.rb b/spec/lib/gitlab/backup/repository_spec.rb index 51c1e9d657b..db860b01ba4 100644 --- a/spec/lib/gitlab/backup/repository_spec.rb +++ b/spec/lib/gitlab/backup/repository_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Backup::Repository, lib: true do +describe Backup::Repository do let(:progress) { StringIO.new } let!(:project) { create(:empty_project) } diff --git a/spec/lib/gitlab/bitbucket_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_import/importer_spec.rb index d8beb05601c..df66a031fec 100644 --- a/spec/lib/gitlab/bitbucket_import/importer_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/importer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::BitbucketImport::Importer, lib: true do +describe Gitlab::BitbucketImport::Importer do include ImportSpecHelper before do @@ -58,7 +58,7 @@ describe Gitlab::BitbucketImport::Importer, lib: true do ) end - let(:importer) { Gitlab::BitbucketImport::Importer.new(project) } + let(:importer) { described_class.new(project) } let(:issues_statuses_sample_data) do { diff --git a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb index 773d0d4d288..d7f7b26740d 100644 --- a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::BitbucketImport::ProjectCreator, lib: true do +describe Gitlab::BitbucketImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do @@ -27,7 +27,7 @@ describe Gitlab::BitbucketImport::ProjectCreator, lib: true do it 'creates project' do allow_any_instance_of(Project).to receive(:add_import_job) - project_creator = Gitlab::BitbucketImport::ProjectCreator.new(repo, 'vim', namespace, user, access_params) + project_creator = described_class.new(repo, 'vim', namespace, user, access_params) project = project_creator.execute expect(project.import_url).to eq("ssh://git@bitbucket.org/asd/vim.git") diff --git a/spec/lib/gitlab/blame_spec.rb b/spec/lib/gitlab/blame_spec.rb index 26b1baf75be..7cab04e9fc9 100644 --- a/spec/lib/gitlab/blame_spec.rb +++ b/spec/lib/gitlab/blame_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Blame, lib: true do +describe Gitlab::Blame do let(:project) { create(:project, :repository) } let(:path) { 'files/ruby/popen.rb' } let(:commit) { project.commit('master') } diff --git a/spec/lib/gitlab/chat_name_token_spec.rb b/spec/lib/gitlab/chat_name_token_spec.rb index 8c1e6efa9db..1e9fb9077fc 100644 --- a/spec/lib/gitlab/chat_name_token_spec.rb +++ b/spec/lib/gitlab/chat_name_token_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ChatNameToken, lib: true do +describe Gitlab::ChatNameToken do context 'when using unknown token' do let(:token) { } diff --git a/spec/lib/gitlab/checks/change_access_spec.rb b/spec/lib/gitlab/checks/change_access_spec.rb index 643e590438a..6c25b7349e1 100644 --- a/spec/lib/gitlab/checks/change_access_spec.rb +++ b/spec/lib/gitlab/checks/change_access_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Checks::ChangeAccess, lib: true do +describe Gitlab::Checks::ChangeAccess do describe '#exec' do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/checks/force_push_spec.rb b/spec/lib/gitlab/checks/force_push_spec.rb index bc66ce83d4a..6c4cfa1203e 100644 --- a/spec/lib/gitlab/checks/force_push_spec.rb +++ b/spec/lib/gitlab/checks/force_push_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Checks::ForcePush, lib: true do +describe Gitlab::Checks::ForcePush do let(:project) { create(:project, :repository) } context "exit code checking" do diff --git a/spec/lib/gitlab/ci_access_spec.rb b/spec/lib/gitlab/ci_access_spec.rb index eaf8f1d0f1c..75b90e76083 100644 --- a/spec/lib/gitlab/ci_access_spec.rb +++ b/spec/lib/gitlab/ci_access_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::CiAccess, lib: true do - let(:access) { Gitlab::CiAccess.new } +describe Gitlab::CiAccess do + let(:access) { described_class.new } describe '#can_do_action?' do context 'when action is :build_download_code' do diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb index fe988266ae3..8ff6125ada1 100644 --- a/spec/lib/gitlab/closing_issue_extractor_spec.rb +++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ClosingIssueExtractor, lib: true do +describe Gitlab::ClosingIssueExtractor do let(:project) { create(:empty_project) } let(:project2) { create(:empty_project) } let(:forked_project) { Projects::ForkService.new(project, project.creator).execute } diff --git a/spec/lib/gitlab/color_schemes_spec.rb b/spec/lib/gitlab/color_schemes_spec.rb index 0a1ec66f199..c7be45dbcd3 100644 --- a/spec/lib/gitlab/color_schemes_spec.rb +++ b/spec/lib/gitlab/color_schemes_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ColorSchemes, lib: true do +describe Gitlab::ColorSchemes do describe '.body_classes' do it 'returns a space-separated list of class names' do css = described_class.body_classes diff --git a/spec/lib/gitlab/conflict/file_collection_spec.rb b/spec/lib/gitlab/conflict/file_collection_spec.rb index 27f23ea70dc..a4d7628b03a 100644 --- a/spec/lib/gitlab/conflict/file_collection_spec.rb +++ b/spec/lib/gitlab/conflict/file_collection_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Conflict::FileCollection, lib: true do +describe Gitlab::Conflict::FileCollection do let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') } let(:file_collection) { described_class.read_only(merge_request) } diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb index 585eeb77bd5..5356e9742b4 100644 --- a/spec/lib/gitlab/conflict/file_spec.rb +++ b/spec/lib/gitlab/conflict/file_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Conflict::File, lib: true do +describe Gitlab::Conflict::File do let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:rugged) { repository.rugged } @@ -10,7 +10,7 @@ describe Gitlab::Conflict::File, lib: true do let(:index) { rugged.merge_commits(our_commit, their_commit) } let(:conflict) { index.conflicts.last } let(:merge_file_result) { index.merge_file('files/ruby/regex.rb') } - let(:conflict_file) { Gitlab::Conflict::File.new(merge_file_result, conflict, merge_request: merge_request) } + let(:conflict_file) { described_class.new(merge_file_result, conflict, merge_request: merge_request) } describe '#resolve_lines' do let(:section_keys) { conflict_file.sections.map { |section| section[:id] }.compact } @@ -220,7 +220,7 @@ end FILE end - let(:conflict_file) { Gitlab::Conflict::File.new({ data: file }, conflict, merge_request: merge_request) } + let(:conflict_file) { described_class.new({ data: file }, conflict, merge_request: merge_request) } let(:sections) { conflict_file.sections } it 'sets the correct match line headers' do diff --git a/spec/lib/gitlab/conflict/parser_spec.rb b/spec/lib/gitlab/conflict/parser_spec.rb index aed57b75789..fce606a2bb5 100644 --- a/spec/lib/gitlab/conflict/parser_spec.rb +++ b/spec/lib/gitlab/conflict/parser_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::Conflict::Parser, lib: true do - let(:parser) { Gitlab::Conflict::Parser.new } +describe Gitlab::Conflict::Parser do + let(:parser) { described_class.new } describe '#parse' do def parse_text(text) diff --git a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb index 3dd76ba5b8a..592448aef96 100644 --- a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::StageSummary, models: true do +describe Gitlab::CycleAnalytics::StageSummary do let(:project) { create(:project, :repository) } let(:from) { 1.day.ago } let(:user) { create(:user, :admin) } diff --git a/spec/lib/gitlab/data_builder/note_spec.rb b/spec/lib/gitlab/data_builder/note_spec.rb index 04ec34492e1..6415e4083d6 100644 --- a/spec/lib/gitlab/data_builder/note_spec.rb +++ b/spec/lib/gitlab/data_builder/note_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Note, lib: true do +describe Gitlab::DataBuilder::Note do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:data) { described_class.build(note, user) } diff --git a/spec/lib/gitlab/data_builder/push_spec.rb b/spec/lib/gitlab/data_builder/push_spec.rb index 73936969832..cb430b47463 100644 --- a/spec/lib/gitlab/data_builder/push_spec.rb +++ b/spec/lib/gitlab/data_builder/push_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Push, lib: true do +describe Gitlab::DataBuilder::Push do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index a2acd15c8fb..d3dbd82e8ba 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -describe Gitlab::Database::MigrationHelpers, lib: true do +describe Gitlab::Database::MigrationHelpers do let(:model) do ActiveRecord::Migration.new.extend( - Gitlab::Database::MigrationHelpers + described_class ) end diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index cbf6c35356e..c5f9aecd867 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Database, lib: true do +describe Gitlab::Database do before do stub_const('MigrationTest', Class.new { include Gitlab::Database }) end diff --git a/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb index df77f4037af..3a93d5e1e97 100644 --- a/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::CartfileLinker, lib: true do +describe Gitlab::DependencyLinker::CartfileLinker do describe '.support?' do it 'supports Cartfile' do expect(described_class.support?('Cartfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb index d7a926e800f..4d222564fd0 100644 --- a/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::ComposerJsonLinker, lib: true do +describe Gitlab::DependencyLinker::ComposerJsonLinker do describe '.support?' do it 'supports composer.json' do expect(described_class.support?('composer.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb index 3f8335f03ea..a97803b119e 100644 --- a/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::GemfileLinker, lib: true do +describe Gitlab::DependencyLinker::GemfileLinker do describe '.support?' do it 'supports Gemfile' do expect(described_class.support?('Gemfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb b/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb index d4a71403939..24ad7d12f4c 100644 --- a/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::GemspecLinker, lib: true do +describe Gitlab::DependencyLinker::GemspecLinker do describe '.support?' do it 'supports *.gemspec' do expect(described_class.support?('gitlab_git.gemspec')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb index e279e0c9019..ae5ad39ad11 100644 --- a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::GodepsJsonLinker, lib: true do +describe Gitlab::DependencyLinker::GodepsJsonLinker do describe '.support?' do it 'supports Godeps.json' do expect(described_class.support?('Godeps.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb index 8c979ae1869..1e8b72afb7b 100644 --- a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::PackageJsonLinker, lib: true do +describe Gitlab::DependencyLinker::PackageJsonLinker do describe '.support?' do it 'supports package.json' do expect(described_class.support?('package.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb index 06007cf97f7..cdfd7ad9826 100644 --- a/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::PodfileLinker, lib: true do +describe Gitlab::DependencyLinker::PodfileLinker do describe '.support?' do it 'supports Podfile' do expect(described_class.support?('Podfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb index d722865264b..d4a398c5948 100644 --- a/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::PodspecJsonLinker, lib: true do +describe Gitlab::DependencyLinker::PodspecJsonLinker do describe '.support?' do it 'supports *.podspec.json' do expect(described_class.support?('Reachability.podspec.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb index dfc366b5817..ed60ab45955 100644 --- a/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::PodspecLinker, lib: true do +describe Gitlab::DependencyLinker::PodspecLinker do describe '.support?' do it 'supports *.podspec' do expect(described_class.support?('Reachability.podspec')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb b/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb index 64b233f3e68..ef952b3abd5 100644 --- a/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do +describe Gitlab::DependencyLinker::RequirementsTxtLinker do describe '.support?' do it 'supports requirements.txt' do expect(described_class.support?('requirements.txt')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker_spec.rb b/spec/lib/gitlab/dependency_linker_spec.rb index 3d1cfbcfbf7..10d2f701298 100644 --- a/spec/lib/gitlab/dependency_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Gitlab::DependencyLinker, lib: true do +describe Gitlab::DependencyLinker do describe '.link' do it 'links using GemfileLinker' do blob_name = 'Gemfile' diff --git a/spec/lib/gitlab/diff/diff_refs_spec.rb b/spec/lib/gitlab/diff/diff_refs_spec.rb index a8173558c00..c73708d90a8 100644 --- a/spec/lib/gitlab/diff/diff_refs_spec.rb +++ b/spec/lib/gitlab/diff/diff_refs_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::DiffRefs, lib: true do +describe Gitlab::Diff::DiffRefs do let(:project) { create(:project, :repository) } describe '#compare_in' do diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index f289131cc3a..cd2fa98b14c 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::File, lib: true do +describe Gitlab::Diff::File do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/highlight_spec.rb b/spec/lib/gitlab/diff/highlight_spec.rb index 7d7d4a55e63..cd602ccab8e 100644 --- a/spec/lib/gitlab/diff/highlight_spec.rb +++ b/spec/lib/gitlab/diff/highlight_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::Highlight, lib: true do +describe Gitlab::Diff::Highlight do include RepoHelpers let(:project) { create(:project, :repository) } @@ -10,7 +10,7 @@ describe Gitlab::Diff::Highlight, lib: true do describe '#highlight' do context "with a diff file" do - let(:subject) { Gitlab::Diff::Highlight.new(diff_file, repository: project.repository).highlight } + let(:subject) { described_class.new(diff_file, repository: project.repository).highlight } it 'returns Gitlab::Diff::Line elements' do expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line) @@ -41,7 +41,7 @@ describe Gitlab::Diff::Highlight, lib: true do end context "with diff lines" do - let(:subject) { Gitlab::Diff::Highlight.new(diff_file.diff_lines, repository: project.repository).highlight } + let(:subject) { described_class.new(diff_file.diff_lines, repository: project.repository).highlight } it 'returns Gitlab::Diff::Line elements' do expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line) diff --git a/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb index d6e8b8ac4b2..046b096e366 100644 --- a/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiffMarkdownMarker, lib: true do +describe Gitlab::Diff::InlineDiffMarkdownMarker do describe '#mark' do let(:raw) { "abc 'def'" } let(:inline_diffs) { [2..5] } diff --git a/spec/lib/gitlab/diff/inline_diff_marker_spec.rb b/spec/lib/gitlab/diff/inline_diff_marker_spec.rb index 95da344802d..c3bf34c24ae 100644 --- a/spec/lib/gitlab/diff/inline_diff_marker_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_marker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiffMarker, lib: true do +describe Gitlab::Diff::InlineDiffMarker do describe '#mark' do context "when the rich text is html safe" do let(:raw) { "abc 'def'" } diff --git a/spec/lib/gitlab/diff/inline_diff_spec.rb b/spec/lib/gitlab/diff/inline_diff_spec.rb index 8ca3f73509e..15451c2cf99 100644 --- a/spec/lib/gitlab/diff/inline_diff_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiff, lib: true do +describe Gitlab::Diff::InlineDiff do describe '.for_lines' do let(:diff) do <<-EOF.strip_heredoc diff --git a/spec/lib/gitlab/diff/line_mapper_spec.rb b/spec/lib/gitlab/diff/line_mapper_spec.rb index 2c7ecd1907e..42750bf9ea1 100644 --- a/spec/lib/gitlab/diff/line_mapper_spec.rb +++ b/spec/lib/gitlab/diff/line_mapper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::LineMapper, lib: true do +describe Gitlab::Diff::LineMapper do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/parallel_diff_spec.rb b/spec/lib/gitlab/diff/parallel_diff_spec.rb index 0f779339c54..e9fc7be366a 100644 --- a/spec/lib/gitlab/diff/parallel_diff_spec.rb +++ b/spec/lib/gitlab/diff/parallel_diff_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::ParallelDiff, lib: true do +describe Gitlab::Diff::ParallelDiff do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb index e76128ecd87..c71568e2a65 100644 --- a/spec/lib/gitlab/diff/parser_spec.rb +++ b/spec/lib/gitlab/diff/parser_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' -describe Gitlab::Diff::Parser, lib: true do +describe Gitlab::Diff::Parser do include RepoHelpers let(:project) { create(:project) } let(:commit) { project.commit(sample_commit.id) } let(:diff) { commit.raw_diffs.first } - let(:parser) { Gitlab::Diff::Parser.new } + let(:parser) { described_class.new } describe '#parse' do let(:diff) do diff --git a/spec/lib/gitlab/diff/position_spec.rb b/spec/lib/gitlab/diff/position_spec.rb index b3d46e69ccb..d4a2a852c12 100644 --- a/spec/lib/gitlab/diff/position_spec.rb +++ b/spec/lib/gitlab/diff/position_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::Position, lib: true do +describe Gitlab::Diff::Position do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/position_tracer_spec.rb b/spec/lib/gitlab/diff/position_tracer_spec.rb index 93d30b90937..8beebc10040 100644 --- a/spec/lib/gitlab/diff/position_tracer_spec.rb +++ b/spec/lib/gitlab/diff/position_tracer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Diff::PositionTracer, lib: true do +describe Gitlab::Diff::PositionTracer do # Douwe's diary New York City, 2016-06-28 # -------------------------------------------------------------------------- # diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb index 08b2577ecc4..f61dbc67ad1 100644 --- a/spec/lib/gitlab/email/attachment_uploader_spec.rb +++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe Gitlab::Email::AttachmentUploader, lib: true do +describe Gitlab::Email::AttachmentUploader do describe "#execute" do let(:project) { build(:project) } let(:message_raw) { fixture_file("emails/attachment.eml") } diff --git a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb index 4a9c9a7fe34..bd36d1d309d 100644 --- a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require_relative '../email_shared_blocks' -describe Gitlab::Email::Handler::CreateIssueHandler, lib: true do +describe Gitlab::Email::Handler::CreateIssueHandler do include_context :email_shared_context it_behaves_like :reply_processing_shared_examples diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index cd0309e248d..0127b012c91 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require_relative '../email_shared_blocks' -describe Gitlab::Email::Handler::CreateNoteHandler, lib: true do +describe Gitlab::Email::Handler::CreateNoteHandler do include_context :email_shared_context it_behaves_like :reply_processing_shared_examples diff --git a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb index 0939e6c4514..66c38498e4e 100644 --- a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require_relative '../email_shared_blocks' -describe Gitlab::Email::Handler::UnsubscribeHandler, lib: true do +describe Gitlab::Email::Handler::UnsubscribeHandler do include_context :email_shared_context before do diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index c6e3524f743..88565ea5311 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require_relative 'email_shared_blocks' -describe Gitlab::Email::Receiver, lib: true do +describe Gitlab::Email::Receiver do include_context :email_shared_context context "when the email contains a valid email address in a Delivered-To header" do diff --git a/spec/lib/gitlab/email/reply_parser_spec.rb b/spec/lib/gitlab/email/reply_parser_spec.rb index 2ea5e6460a3..e21a998adfe 100644 --- a/spec/lib/gitlab/email/reply_parser_spec.rb +++ b/spec/lib/gitlab/email/reply_parser_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" # Inspired in great part by Discourse's Email::Receiver -describe Gitlab::Email::ReplyParser, lib: true do +describe Gitlab::Email::ReplyParser do describe '#execute' do def test_parse_body(mail_string) described_class.new(Mail::Message.new(mail_string)).execute diff --git a/spec/lib/gitlab/exclusive_lease_spec.rb b/spec/lib/gitlab/exclusive_lease_spec.rb index 590d6da4113..c1ed47cf64a 100644 --- a/spec/lib/gitlab/exclusive_lease_spec.rb +++ b/spec/lib/gitlab/exclusive_lease_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ExclusiveLease, type: :clean_gitlab_redis_shared_state do +describe Gitlab::ExclusiveLease, :clean_gitlab_redis_shared_state do let(:unique_key) { SecureRandom.hex(10) } describe '#try_obtain' do diff --git a/spec/lib/gitlab/file_finder_spec.rb b/spec/lib/gitlab/file_finder_spec.rb index 5a32ffd462c..3fb6315a39a 100644 --- a/spec/lib/gitlab/file_finder_spec.rb +++ b/spec/lib/gitlab/file_finder_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::FileFinder, lib: true do +describe Gitlab::FileFinder do describe '#find' do let(:project) { create(:project, :public, :repository) } let(:finder) { described_class.new(project, project.default_branch) } diff --git a/spec/lib/gitlab/fogbugz_import/client_spec.rb b/spec/lib/gitlab/fogbugz_import/client_spec.rb index 252cd4c55c7..dcd1a2d9813 100644 --- a/spec/lib/gitlab/fogbugz_import/client_spec.rb +++ b/spec/lib/gitlab/fogbugz_import/client_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::FogbugzImport::Client, lib: true do +describe Gitlab::FogbugzImport::Client do let(:client) { described_class.new(uri: '', token: '') } let(:one_user) { { 'people' => { 'person' => { "ixPerson" => "2", "sFullName" => "James" } } } } let(:two_users) { { 'people' => { 'person' => [one_user, { "ixPerson" => "3" }] } } } diff --git a/spec/lib/gitlab/git/hook_spec.rb b/spec/lib/gitlab/git/hook_spec.rb index 19f45ea1cb2..19391a70cf6 100644 --- a/spec/lib/gitlab/git/hook_spec.rb +++ b/spec/lib/gitlab/git/hook_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper' require 'fileutils' -describe Gitlab::Git::Hook, lib: true do +describe Gitlab::Git::Hook do before do # We need this because in the spec/spec_helper.rb we define it like this: # allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_return([true, nil]) - allow_any_instance_of(Gitlab::Git::Hook).to receive(:trigger).and_call_original + allow_any_instance_of(described_class).to receive(:trigger).and_call_original end describe "#trigger" do @@ -48,7 +48,7 @@ describe Gitlab::Git::Hook, lib: true do it "returns success with no errors" do create_hook(hook_name) - hook = Gitlab::Git::Hook.new(hook_name, project) + hook = described_class.new(hook_name, project) blank = Gitlab::Git::BLANK_SHA ref = Gitlab::Git::BRANCH_REF_PREFIX + 'new_branch' @@ -66,7 +66,7 @@ describe Gitlab::Git::Hook, lib: true do context "when the hook is unsuccessful" do it "returns failure with errors" do create_failing_hook(hook_name) - hook = Gitlab::Git::Hook.new(hook_name, project) + hook = described_class.new(hook_name, project) blank = Gitlab::Git::BLANK_SHA ref = Gitlab::Git::BRANCH_REF_PREFIX + 'new_branch' @@ -80,7 +80,7 @@ describe Gitlab::Git::Hook, lib: true do context "when the hook doesn't exist" do it "returns success with no errors" do - hook = Gitlab::Git::Hook.new('unknown_hook', project) + hook = described_class.new('unknown_hook', project) blank = Gitlab::Git::BLANK_SHA ref = Gitlab::Git::BRANCH_REF_PREFIX + 'new_branch' diff --git a/spec/lib/gitlab/git/rev_list_spec.rb b/spec/lib/gitlab/git/rev_list_spec.rb index 78894ba9409..b051a088171 100644 --- a/spec/lib/gitlab/git/rev_list_spec.rb +++ b/spec/lib/gitlab/git/rev_list_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Git::RevList, lib: true do +describe Gitlab::Git::RevList do let(:project) { create(:project, :repository) } before do @@ -11,7 +11,7 @@ describe Gitlab::Git::RevList, lib: true do end context "#new_refs" do - let(:rev_list) { Gitlab::Git::RevList.new(newrev: 'newrev', path_to_repo: project.repository.path_to_repo) } + let(:rev_list) { described_class.new(newrev: 'newrev', path_to_repo: project.repository.path_to_repo) } it 'calls out to `popen`' do expect(Gitlab::Popen).to receive(:popen).with([ @@ -33,7 +33,7 @@ describe Gitlab::Git::RevList, lib: true do end context "#missed_ref" do - let(:rev_list) { Gitlab::Git::RevList.new(oldrev: 'oldrev', newrev: 'newrev', path_to_repo: project.repository.path_to_repo) } + let(:rev_list) { described_class.new(oldrev: 'oldrev', newrev: 'newrev', path_to_repo: project.repository.path_to_repo) } it 'calls out to `popen`' do expect(Gitlab::Popen).to receive(:popen).with([ diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index 9a86cfa66e4..2d6ea37d0ac 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -describe Gitlab::GitAccess, lib: true do +describe Gitlab::GitAccess do let(:pull_access_check) { access.check('git-upload-pack', '_any') } let(:push_access_check) { access.check('git-receive-pack', '_any') } - let(:access) { Gitlab::GitAccess.new(actor, project, protocol, authentication_abilities: authentication_abilities, redirected_path: redirected_path) } + let(:access) { described_class.new(actor, project, protocol, authentication_abilities: authentication_abilities, redirected_path: redirected_path) } let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:actor) { user } @@ -280,7 +280,7 @@ describe Gitlab::GitAccess, lib: true do context 'when project is public' do let(:public_project) { create(:project, :public, :repository) } - let(:access) { Gitlab::GitAccess.new(nil, public_project, 'web', authentication_abilities: []) } + let(:access) { described_class.new(nil, public_project, 'web', authentication_abilities: []) } context 'when repository is enabled' do it 'give access to download code' do @@ -441,7 +441,7 @@ describe Gitlab::GitAccess, lib: true do end permissions_matrix[role].each do |action, allowed| - context action do + context action.to_s do subject { access.send(:check_push_access!, changes[action]) } it do diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb index 797ec8cb23e..0376b4ee783 100644 --- a/spec/lib/gitlab/git_access_wiki_spec.rb +++ b/spec/lib/gitlab/git_access_wiki_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::GitAccessWiki, lib: true do - let(:access) { Gitlab::GitAccessWiki.new(user, project, 'web', authentication_abilities: authentication_abilities, redirected_path: redirected_path) } +describe Gitlab::GitAccessWiki do + let(:access) { described_class.new(user, project, 'web', authentication_abilities: authentication_abilities, redirected_path: redirected_path) } let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:redirected_path) { nil } diff --git a/spec/lib/gitlab/git_ref_validator_spec.rb b/spec/lib/gitlab/git_ref_validator_spec.rb index cc8daa535d6..e1fa8ae03f8 100644 --- a/spec/lib/gitlab/git_ref_validator_spec.rb +++ b/spec/lib/gitlab/git_ref_validator_spec.rb @@ -1,25 +1,25 @@ require 'spec_helper' -describe Gitlab::GitRefValidator, lib: true do - it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy } - it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy } - it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy } - it { expect(Gitlab::GitRefValidator.validate('#1')).to be_truthy } - it { expect(Gitlab::GitRefValidator.validate('feature/refs/heads/foo')).to be_truthy } - it { expect(Gitlab::GitRefValidator.validate('feature/~new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/^new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/:new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/?new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/*new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/[new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/new/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature/new.')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature\@{')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature\new')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature//new')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('feature new')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('refs/heads/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('refs/remotes/')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('refs/heads/feature')).to be_falsey } - it { expect(Gitlab::GitRefValidator.validate('refs/remotes/origin')).to be_falsey } +describe Gitlab::GitRefValidator do + it { expect(described_class.validate('feature/new')).to be_truthy } + it { expect(described_class.validate('implement_@all')).to be_truthy } + it { expect(described_class.validate('my_new_feature')).to be_truthy } + it { expect(described_class.validate('#1')).to be_truthy } + it { expect(described_class.validate('feature/refs/heads/foo')).to be_truthy } + it { expect(described_class.validate('feature/~new/')).to be_falsey } + it { expect(described_class.validate('feature/^new/')).to be_falsey } + it { expect(described_class.validate('feature/:new/')).to be_falsey } + it { expect(described_class.validate('feature/?new/')).to be_falsey } + it { expect(described_class.validate('feature/*new/')).to be_falsey } + it { expect(described_class.validate('feature/[new/')).to be_falsey } + it { expect(described_class.validate('feature/new/')).to be_falsey } + it { expect(described_class.validate('feature/new.')).to be_falsey } + it { expect(described_class.validate('feature\@{')).to be_falsey } + it { expect(described_class.validate('feature\new')).to be_falsey } + it { expect(described_class.validate('feature//new')).to be_falsey } + it { expect(described_class.validate('feature new')).to be_falsey } + it { expect(described_class.validate('refs/heads/')).to be_falsey } + it { expect(described_class.validate('refs/remotes/')).to be_falsey } + it { expect(described_class.validate('refs/heads/feature')).to be_falsey } + it { expect(described_class.validate('refs/remotes/origin')).to be_falsey } end diff --git a/spec/lib/gitlab/git_spec.rb b/spec/lib/gitlab/git_spec.rb index 36f0e6507c8..4702a978f19 100644 --- a/spec/lib/gitlab/git_spec.rb +++ b/spec/lib/gitlab/git_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' -describe Gitlab::Git, lib: true do +describe Gitlab::Git do let(:committer_email) { 'user@example.org' } let(:committer_name) { 'John Doe' } describe 'committer_hash' do it "returns a hash containing the given email and name" do - committer_hash = Gitlab::Git.committer_hash(email: committer_email, name: committer_name) + committer_hash = described_class.committer_hash(email: committer_email, name: committer_name) expect(committer_hash[:email]).to eq(committer_email) expect(committer_hash[:name]).to eq(committer_name) @@ -15,7 +15,7 @@ describe Gitlab::Git, lib: true do context 'when email is nil' do it "returns nil" do - committer_hash = Gitlab::Git.committer_hash(email: nil, name: committer_name) + committer_hash = described_class.committer_hash(email: nil, name: committer_name) expect(committer_hash).to be_nil end @@ -23,7 +23,7 @@ describe Gitlab::Git, lib: true do context 'when name is nil' do it "returns nil" do - committer_hash = Gitlab::Git.committer_hash(email: committer_email, name: nil) + committer_hash = described_class.committer_hash(email: committer_email, name: nil) expect(committer_hash).to be_nil end diff --git a/spec/lib/gitlab/gitaly_client/diff_spec.rb b/spec/lib/gitlab/gitaly_client/diff_spec.rb index 2960c9a79ad..00a31ac0b96 100644 --- a/spec/lib/gitlab/gitaly_client/diff_spec.rb +++ b/spec/lib/gitlab/gitaly_client/diff_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GitalyClient::Diff, lib: true do +describe Gitlab::GitalyClient::Diff do let(:diff_fields) do { to_path: ".gitmodules", diff --git a/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb b/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb index 07650013052..cd3242b9326 100644 --- a/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb +++ b/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GitalyClient::DiffStitcher, lib: true do +describe Gitlab::GitalyClient::DiffStitcher do describe 'enumeration' do it 'combines segregated diff messages together' do diff_1 = OpenStruct.new( diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index 558ddb3fbd6..921e786a55c 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' # We stub Gitaly in `spec/support/gitaly.rb` for other tests. We don't want # those stubs while testing the GitalyClient itself. -describe Gitlab::GitalyClient, lib: true, skip_gitaly_mock: true do +describe Gitlab::GitalyClient, skip_gitaly_mock: true do describe '.stub' do # Notice that this is referring to gRPC "stubs", not rspec stubs before do diff --git a/spec/lib/gitlab/github_import/branch_formatter_spec.rb b/spec/lib/gitlab/github_import/branch_formatter_spec.rb index 3a31f93efa5..426b43f8b51 100644 --- a/spec/lib/gitlab/github_import/branch_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/branch_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::BranchFormatter, lib: true do +describe Gitlab::GithubImport::BranchFormatter do let(:project) { create(:project, :repository) } let(:commit) { create(:commit, project: project) } let(:repo) { double } diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb index 21f2a9e225b..66273255b6f 100644 --- a/spec/lib/gitlab/github_import/client_spec.rb +++ b/spec/lib/gitlab/github_import/client_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::Client, lib: true do +describe Gitlab::GithubImport::Client do let(:token) { '123456' } let(:github_provider) { Settingslogic.new('app_id' => 'asd123', 'app_secret' => 'asd123', 'name' => 'github', 'args' => { 'client_options' => {} }) } diff --git a/spec/lib/gitlab/github_import/comment_formatter_spec.rb b/spec/lib/gitlab/github_import/comment_formatter_spec.rb index cc38872e426..ef89634685a 100644 --- a/spec/lib/gitlab/github_import/comment_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/comment_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::CommentFormatter, lib: true do +describe Gitlab::GithubImport::CommentFormatter do let(:client) { double } let(:project) { create(:empty_project) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/github_import/importer_spec.rb b/spec/lib/gitlab/github_import/importer_spec.rb index 9d5e20841b5..d00a2deaf7b 100644 --- a/spec/lib/gitlab/github_import/importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer, lib: true do +describe Gitlab::GithubImport::Importer do shared_examples 'Gitlab::GithubImport::Importer#execute' do let(:expected_not_called) { [] } diff --git a/spec/lib/gitlab/github_import/issuable_formatter_spec.rb b/spec/lib/gitlab/github_import/issuable_formatter_spec.rb index 6bc5f98ed2c..05294d227bd 100644 --- a/spec/lib/gitlab/github_import/issuable_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/issuable_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::IssuableFormatter, lib: true do +describe Gitlab::GithubImport::IssuableFormatter do let(:raw_data) do double(number: 42) end diff --git a/spec/lib/gitlab/github_import/issue_formatter_spec.rb b/spec/lib/gitlab/github_import/issue_formatter_spec.rb index a4089592cf2..39b15926193 100644 --- a/spec/lib/gitlab/github_import/issue_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/issue_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::IssueFormatter, lib: true do +describe Gitlab::GithubImport::IssueFormatter do let(:client) { double } let!(:project) { create(:empty_project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/github_import/label_formatter_spec.rb b/spec/lib/gitlab/github_import/label_formatter_spec.rb index 565435824fd..2cc7ac0b446 100644 --- a/spec/lib/gitlab/github_import/label_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/label_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::LabelFormatter, lib: true do +describe Gitlab::GithubImport::LabelFormatter do let(:project) { create(:empty_project) } let(:raw) { double(name: 'improvements', color: 'e6e6e6') } diff --git a/spec/lib/gitlab/github_import/milestone_formatter_spec.rb b/spec/lib/gitlab/github_import/milestone_formatter_spec.rb index 6d38041c468..310e0536fd7 100644 --- a/spec/lib/gitlab/github_import/milestone_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/milestone_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::MilestoneFormatter, lib: true do +describe Gitlab::GithubImport::MilestoneFormatter do let(:project) { create(:empty_project) } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } let(:updated_at) { DateTime.strptime('2011-01-27T19:01:12Z') } diff --git a/spec/lib/gitlab/github_import/project_creator_spec.rb b/spec/lib/gitlab/github_import/project_creator_spec.rb index a73b1f4ff5d..948e7469a18 100644 --- a/spec/lib/gitlab/github_import/project_creator_spec.rb +++ b/spec/lib/gitlab/github_import/project_creator_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::ProjectCreator, lib: true do +describe Gitlab::GithubImport::ProjectCreator do let(:user) { create(:user) } let(:namespace) { create(:group, owner: user) } diff --git a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb index b7c59918a76..2e42f6239b7 100644 --- a/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/pull_request_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::PullRequestFormatter, lib: true do +describe Gitlab::GithubImport::PullRequestFormatter do let(:client) { double } let(:project) { create(:project, :repository) } let(:source_sha) { create(:commit, project: project).id } diff --git a/spec/lib/gitlab/github_import/release_formatter_spec.rb b/spec/lib/gitlab/github_import/release_formatter_spec.rb index 13b15e669ab..1357cb636ae 100644 --- a/spec/lib/gitlab/github_import/release_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/release_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::ReleaseFormatter, lib: true do +describe Gitlab::GithubImport::ReleaseFormatter do let!(:project) { create(:empty_project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat') } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } diff --git a/spec/lib/gitlab/github_import/user_formatter_spec.rb b/spec/lib/gitlab/github_import/user_formatter_spec.rb index db792233657..98e3a7c28b9 100644 --- a/spec/lib/gitlab/github_import/user_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/user_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::UserFormatter, lib: true do +describe Gitlab::GithubImport::UserFormatter do let(:client) { double } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb index 1bd29b8a563..de50265bc14 100644 --- a/spec/lib/gitlab/github_import/wiki_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/wiki_formatter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GithubImport::WikiFormatter, lib: true do +describe Gitlab::GithubImport::WikiFormatter do let(:project) do create(:project, namespace: create(:namespace, path: 'gitlabhq'), diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb index cd8e805466a..50e8d7183ce 100644 --- a/spec/lib/gitlab/gitlab_import/client_spec.rb +++ b/spec/lib/gitlab/gitlab_import/client_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -describe Gitlab::GitlabImport::Client, lib: true do +describe Gitlab::GitlabImport::Client do include ImportSpecHelper let(:token) { '123456' } - let(:client) { Gitlab::GitlabImport::Client.new(token) } + let(:client) { described_class.new(token) } before do stub_omniauth_provider('gitlab') diff --git a/spec/lib/gitlab/gitlab_import/importer_spec.rb b/spec/lib/gitlab/gitlab_import/importer_spec.rb index 4f588da0a83..16b14474b89 100644 --- a/spec/lib/gitlab/gitlab_import/importer_spec.rb +++ b/spec/lib/gitlab/gitlab_import/importer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GitlabImport::Importer, lib: true do +describe Gitlab::GitlabImport::Importer do include ImportSpecHelper describe '#execute' do diff --git a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb index 483f65cd053..da48d8f0670 100644 --- a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb +++ b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GitlabImport::ProjectCreator, lib: true do +describe Gitlab::GitlabImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do { @@ -23,7 +23,7 @@ describe Gitlab::GitlabImport::ProjectCreator, lib: true do it 'creates project' do allow_any_instance_of(Project).to receive(:add_import_job) - project_creator = Gitlab::GitlabImport::ProjectCreator.new(repo, namespace, user, access_params) + project_creator = described_class.new(repo, namespace, user, access_params) project = project_creator.execute expect(project.import_url).to eq("https://oauth2:asdffg@gitlab.com/asd/vim.git") diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb index 85949ae8dc4..37985c062b4 100644 --- a/spec/lib/gitlab/google_code_import/client_spec.rb +++ b/spec/lib/gitlab/google_code_import/client_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe Gitlab::GoogleCodeImport::Client, lib: true do +describe Gitlab::GoogleCodeImport::Client do let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) } subject { described_class.new(raw_data) } diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb index 622a0f513f4..85f40825005 100644 --- a/spec/lib/gitlab/google_code_import/importer_spec.rb +++ b/spec/lib/gitlab/google_code_import/importer_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe Gitlab::GoogleCodeImport::Importer, lib: true do +describe Gitlab::GoogleCodeImport::Importer do let(:mapped_user) { create(:user, username: "thilo123") } let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) } let(:client) { Gitlab::GoogleCodeImport::Client.new(raw_data) } diff --git a/spec/lib/gitlab/google_code_import/project_creator_spec.rb b/spec/lib/gitlab/google_code_import/project_creator_spec.rb index 499a896ee76..aad53938d52 100644 --- a/spec/lib/gitlab/google_code_import/project_creator_spec.rb +++ b/spec/lib/gitlab/google_code_import/project_creator_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::GoogleCodeImport::ProjectCreator, lib: true do +describe Gitlab::GoogleCodeImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do Gitlab::GoogleCodeImport::Repository.new( @@ -18,7 +18,7 @@ describe Gitlab::GoogleCodeImport::ProjectCreator, lib: true do it 'creates project' do allow_any_instance_of(Project).to receive(:add_import_job) - project_creator = Gitlab::GoogleCodeImport::ProjectCreator.new(repo, namespace, user) + project_creator = described_class.new(repo, namespace, user) project = project_creator.execute expect(project.import_url).to eq("https://vim.googlecode.com/git/") diff --git a/spec/lib/gitlab/graphs/commits_spec.rb b/spec/lib/gitlab/graphs/commits_spec.rb index abb5a26060f..3f9382a9143 100644 --- a/spec/lib/gitlab/graphs/commits_spec.rb +++ b/spec/lib/gitlab/graphs/commits_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Graphs::Commits, lib: true do +describe Gitlab::Graphs::Commits do let!(:project) { create(:empty_project, :public) } let!(:commit1) { create(:commit, git_commit: RepoHelpers.sample_commit, project: project, committed_date: Time.now) } diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb index 07687b470c5..29e61d15726 100644 --- a/spec/lib/gitlab/highlight_spec.rb +++ b/spec/lib/gitlab/highlight_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Highlight, lib: true do +describe Gitlab::Highlight do include RepoHelpers let(:project) { create(:project, :repository) } @@ -12,7 +12,7 @@ describe Gitlab::Highlight, lib: true do let(:blob) { repository.blob_at_branch(branch, path) } let(:highlighter) do - Gitlab::Highlight.new(blob.path, blob.data, repository: repository) + described_class.new(blob.path, blob.data, repository: repository) end before do @@ -42,7 +42,7 @@ describe Gitlab::Highlight, lib: true do let(:path) { 'files/whitespace' } let(:blob) { repository.blob_at_branch(branch, path) } let(:lines) do - Gitlab::Highlight.highlight(blob.path, blob.data, repository: repository).lines + described_class.highlight(blob.path, blob.data, repository: repository).lines end it 'strips extra LFs' do diff --git a/spec/lib/gitlab/i18n_spec.rb b/spec/lib/gitlab/i18n_spec.rb index 0dba4132101..785035d993f 100644 --- a/spec/lib/gitlab/i18n_spec.rb +++ b/spec/lib/gitlab/i18n_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::I18n, lib: true do +describe Gitlab::I18n do let(:user) { create(:user, preferred_language: 'es') } describe '.locale=' do diff --git a/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb b/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb index 63bab0f0d0d..574748756bd 100644 --- a/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb +++ b/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::AttributeCleaner, lib: true do +describe Gitlab::ImportExport::AttributeCleaner do let(:relation_class){ double('relation_class').as_null_object } let(:unsafe_hash) do { diff --git a/spec/lib/gitlab/import_export/attribute_configuration_spec.rb b/spec/lib/gitlab/import_export/attribute_configuration_spec.rb index e24d070706a..65f073b2df3 100644 --- a/spec/lib/gitlab/import_export/attribute_configuration_spec.rb +++ b/spec/lib/gitlab/import_export/attribute_configuration_spec.rb @@ -7,7 +7,7 @@ require 'spec_helper' # to be included as part of the export, or blacklist them using the import_export.yml configuration file. # Likewise, new models added to import_export.yml, will need to be added with their correspondent attributes # to this spec. -describe 'Import/Export attribute configuration', lib: true do +describe 'Import/Export attribute configuration' do include ConfigurationHelper let(:config_hash) { YAML.load_file(Gitlab::ImportExport.config_file).deep_stringify_keys } diff --git a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb index 08a42fd27a2..a7b292c8558 100644 --- a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::AvatarRestorer, lib: true do +describe Gitlab::ImportExport::AvatarRestorer do include UploadHelpers let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: 'test') } diff --git a/spec/lib/gitlab/import_export/avatar_saver_spec.rb b/spec/lib/gitlab/import_export/avatar_saver_spec.rb index 579a31ead58..814f85de03b 100644 --- a/spec/lib/gitlab/import_export/avatar_saver_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_saver_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::AvatarSaver, lib: true do +describe Gitlab::ImportExport::AvatarSaver do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: 'test') } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:project_with_avatar) { create(:empty_project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) } diff --git a/spec/lib/gitlab/import_export/file_importer_spec.rb b/spec/lib/gitlab/import_export/file_importer_spec.rb index b88b9c18c15..690c7625c52 100644 --- a/spec/lib/gitlab/import_export/file_importer_spec.rb +++ b/spec/lib/gitlab/import_export/file_importer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::FileImporter, lib: true do +describe Gitlab::ImportExport::FileImporter do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: 'test') } let(:export_path) { "#{Dir.tmpdir}/file_importer_spec" } let(:valid_file) { "#{shared.export_path}/valid.json" } diff --git a/spec/lib/gitlab/import_export/fork_spec.rb b/spec/lib/gitlab/import_export/fork_spec.rb index e8eb7e4f8f4..08588a76fe6 100644 --- a/spec/lib/gitlab/import_export/fork_spec.rb +++ b/spec/lib/gitlab/import_export/fork_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'forked project import', services: true do +describe 'forked project import' do let(:user) { create(:user) } let!(:project_with_repo) { create(:project, name: 'test-repo-restorer', path: 'test-repo-restorer') } let!(:project) { create(:empty_project, name: 'test-repo-restorer-no-repo', path: 'test-repo-restorer-no-repo') } diff --git a/spec/lib/gitlab/import_export/hash_util_spec.rb b/spec/lib/gitlab/import_export/hash_util_spec.rb index 1c3a0b23ece..366582dece3 100644 --- a/spec/lib/gitlab/import_export/hash_util_spec.rb +++ b/spec/lib/gitlab/import_export/hash_util_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::HashUtil, lib: true do +describe Gitlab::ImportExport::HashUtil do let(:stringified_array) { [{ 'test' => 1 }] } let(:stringified_array_with_date) { [{ 'test_date' => '2016-04-06 06:17:44 +0200' }] } diff --git a/spec/lib/gitlab/import_export/import_export_spec.rb b/spec/lib/gitlab/import_export/import_export_spec.rb index f3fd0d82875..07415d41f93 100644 --- a/spec/lib/gitlab/import_export/import_export_spec.rb +++ b/spec/lib/gitlab/import_export/import_export_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport, services: true do +describe Gitlab::ImportExport do describe 'export filename' do let(:group) { create(:group, :nested) } let(:project) { create(:empty_project, :public, path: 'project-path', namespace: group) } diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb index 3e0291c9ae9..f66a2ab7dda 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::MembersMapper, services: true do +describe Gitlab::ImportExport::MembersMapper do describe 'map members' do let(:user) { create(:admin) } let(:project) { create(:empty_project, :public, name: 'searchable_project') } diff --git a/spec/lib/gitlab/import_export/model_configuration_spec.rb b/spec/lib/gitlab/import_export/model_configuration_spec.rb index 2ede5cdd2ad..5cb8f2589c8 100644 --- a/spec/lib/gitlab/import_export/model_configuration_spec.rb +++ b/spec/lib/gitlab/import_export/model_configuration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' # Part of the test security suite for the Import/Export feature # Finds if a new model has been added that can potentially be part of the Import/Export # If it finds a new model, it will show a +failure_message+ with the options available. -describe 'Import/Export model configuration', lib: true do +describe 'Import/Export model configuration' do include ConfigurationHelper let(:config_hash) { YAML.load_file(Gitlab::ImportExport.config_file).deep_stringify_keys } diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index d50d238ddcd..d1ec0e45bbd 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' include ImportExport::CommonUtil -describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do +describe Gitlab::ImportExport::ProjectTreeRestorer do describe 'restore project tree' do before(:context) do @user = create(:user) diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb index 22a65e24f26..0c7e733b01f 100644 --- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::ProjectTreeSaver, services: true do +describe Gitlab::ImportExport::ProjectTreeSaver do describe 'saves the project tree into a json object' do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.path_with_namespace) } let(:project_tree_saver) { described_class.new(project: project, current_user: user, shared: shared) } diff --git a/spec/lib/gitlab/import_export/reader_spec.rb b/spec/lib/gitlab/import_export/reader_spec.rb index d700af142be..e9f5273725d 100644 --- a/spec/lib/gitlab/import_export/reader_spec.rb +++ b/spec/lib/gitlab/import_export/reader_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::Reader, lib: true do +describe Gitlab::ImportExport::Reader do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: '') } let(:test_config) { 'spec/support/import_export/import_export.yml' } let(:project_tree_hash) do diff --git a/spec/lib/gitlab/import_export/relation_factory_spec.rb b/spec/lib/gitlab/import_export/relation_factory_spec.rb index 5417c7534ea..baa90af84f7 100644 --- a/spec/lib/gitlab/import_export/relation_factory_spec.rb +++ b/spec/lib/gitlab/import_export/relation_factory_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::RelationFactory, lib: true do +describe Gitlab::ImportExport::RelationFactory do let(:project) { create(:empty_project) } let(:members_mapper) { double('members_mapper').as_null_object } let(:user) { create(:admin) } diff --git a/spec/lib/gitlab/import_export/repo_restorer_spec.rb b/spec/lib/gitlab/import_export/repo_restorer_spec.rb index 09bfaa8fb75..d3be2965bf4 100644 --- a/spec/lib/gitlab/import_export/repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/repo_restorer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::RepoRestorer, services: true do +describe Gitlab::ImportExport::RepoRestorer do describe 'bundle a project Git repo' do let(:user) { create(:user) } let!(:project_with_repo) { create(:project, name: 'test-repo-restorer', path: 'test-repo-restorer') } diff --git a/spec/lib/gitlab/import_export/repo_saver_spec.rb b/spec/lib/gitlab/import_export/repo_saver_spec.rb index a7f4e11271e..87af13e0beb 100644 --- a/spec/lib/gitlab/import_export/repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/repo_saver_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::RepoSaver, services: true do +describe Gitlab::ImportExport::RepoSaver do describe 'bundle a project Git repo' do let(:user) { create(:user) } let!(:project) { create(:empty_project, :public, name: 'searchable_project') } diff --git a/spec/lib/gitlab/import_export/version_checker_spec.rb b/spec/lib/gitlab/import_export/version_checker_spec.rb index 2405ac5abfe..e7d50f75682 100644 --- a/spec/lib/gitlab/import_export/version_checker_spec.rb +++ b/spec/lib/gitlab/import_export/version_checker_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' include ImportExport::CommonUtil -describe Gitlab::ImportExport::VersionChecker, services: true do +describe Gitlab::ImportExport::VersionChecker do let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: '') } describe 'bundle a project Git repo' do diff --git a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb index 071e5fac3f0..78137aeff5e 100644 --- a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ImportExport::WikiRepoSaver, services: true do +describe Gitlab::ImportExport::WikiRepoSaver do describe 'bundle a wiki Git repo' do let(:user) { create(:user) } let!(:project) { create(:empty_project, :public, name: 'searchable_project') } diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb index 698bd72d0f8..c959add7a36 100644 --- a/spec/lib/gitlab/incoming_email_spec.rb +++ b/spec/lib/gitlab/incoming_email_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe Gitlab::IncomingEmail, lib: true do +describe Gitlab::IncomingEmail do describe "self.enabled?" do context "when reply by email is enabled" do before do diff --git a/spec/lib/gitlab/issuable_metadata_spec.rb b/spec/lib/gitlab/issuable_metadata_spec.rb index f9f4b290dbf..2455969a183 100644 --- a/spec/lib/gitlab/issuable_metadata_spec.rb +++ b/spec/lib/gitlab/issuable_metadata_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::IssuableMetadata, lib: true do +describe Gitlab::IssuableMetadata do let(:user) { create(:user) } let!(:project) { create(:project, :public, :repository, creator: user, namespace: user.namespace) } diff --git a/spec/lib/gitlab/issuable_sorter_spec.rb b/spec/lib/gitlab/issuable_sorter_spec.rb index c9a434b2bcf..aeb32ef96d6 100644 --- a/spec/lib/gitlab/issuable_sorter_spec.rb +++ b/spec/lib/gitlab/issuable_sorter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::IssuableSorter, lib: true do +describe Gitlab::IssuableSorter do let(:namespace1) { build(:namespace, id: 1) } let(:project1) { build(:project, id: 1, namespace: namespace1) } diff --git a/spec/lib/gitlab/key_fingerprint_spec.rb b/spec/lib/gitlab/key_fingerprint_spec.rb index d09f51f3bfc..d7bebaca675 100644 --- a/spec/lib/gitlab/key_fingerprint_spec.rb +++ b/spec/lib/gitlab/key_fingerprint_spec.rb @@ -1,12 +1,12 @@ require "spec_helper" -describe Gitlab::KeyFingerprint, lib: true do +describe Gitlab::KeyFingerprint do let(:key) { "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" } let(:fingerprint) { "3f:a2:ee:de:b5:de:53:c3:aa:2f:9c:45:24:4c:47:7b" } describe "#fingerprint" do it "generates the key's fingerprint" do - expect(Gitlab::KeyFingerprint.new(key).fingerprint).to eq(fingerprint) + expect(described_class.new(key).fingerprint).to eq(fingerprint) end end end diff --git a/spec/lib/gitlab/lazy_spec.rb b/spec/lib/gitlab/lazy_spec.rb index b5ca89dd242..37a3ac74316 100644 --- a/spec/lib/gitlab/lazy_spec.rb +++ b/spec/lib/gitlab/lazy_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Lazy, lib: true do +describe Gitlab::Lazy do let(:dummy) { double(:dummy) } context 'when not calling any methods' do diff --git a/spec/lib/gitlab/ldap/access_spec.rb b/spec/lib/gitlab/ldap/access_spec.rb index 756fcb0fcaf..6a47350be81 100644 --- a/spec/lib/gitlab/ldap/access_spec.rb +++ b/spec/lib/gitlab/ldap/access_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::LDAP::Access, lib: true do - let(:access) { Gitlab::LDAP::Access.new user } +describe Gitlab::LDAP::Access do + let(:access) { described_class.new user } let(:user) { create(:omniauth_user) } describe '.allowed?' do diff --git a/spec/lib/gitlab/ldap/adapter_spec.rb b/spec/lib/gitlab/ldap/adapter_spec.rb index 0f4b8dbf7b7..d17d440d833 100644 --- a/spec/lib/gitlab/ldap/adapter_spec.rb +++ b/spec/lib/gitlab/ldap/adapter_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::LDAP::Adapter, lib: true do +describe Gitlab::LDAP::Adapter do include LdapHelpers let(:ldap) { double(:ldap) } diff --git a/spec/lib/gitlab/ldap/auth_hash_spec.rb b/spec/lib/gitlab/ldap/auth_hash_spec.rb index 7a2f774b948..57a91193004 100644 --- a/spec/lib/gitlab/ldap/auth_hash_spec.rb +++ b/spec/lib/gitlab/ldap/auth_hash_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' -describe Gitlab::LDAP::AuthHash, lib: true do +describe Gitlab::LDAP::AuthHash do let(:auth_hash) do - Gitlab::LDAP::AuthHash.new( + described_class.new( OmniAuth::AuthHash.new( uid: '123456', provider: 'ldapmain', diff --git a/spec/lib/gitlab/ldap/authentication_spec.rb b/spec/lib/gitlab/ldap/authentication_spec.rb index f689b47fec4..01b6282af0c 100644 --- a/spec/lib/gitlab/ldap/authentication_spec.rb +++ b/spec/lib/gitlab/ldap/authentication_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::LDAP::Authentication, lib: true do +describe Gitlab::LDAP::Authentication do let(:user) { create(:omniauth_user, extern_uid: dn) } let(:dn) { 'uid=john,ou=people,dc=example,dc=com' } let(:login) { 'john' } diff --git a/spec/lib/gitlab/ldap/config_spec.rb b/spec/lib/gitlab/ldap/config_spec.rb index 3a56797d68b..292ec064a67 100644 --- a/spec/lib/gitlab/ldap/config_spec.rb +++ b/spec/lib/gitlab/ldap/config_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' -describe Gitlab::LDAP::Config, lib: true do +describe Gitlab::LDAP::Config do include LdapHelpers - let(:config) { Gitlab::LDAP::Config.new('ldapmain') } + let(:config) { described_class.new('ldapmain') } describe '#initialize' do it 'requires a provider' do - expect{ Gitlab::LDAP::Config.new }.to raise_error ArgumentError + expect{ described_class.new }.to raise_error ArgumentError end it 'works' do @@ -15,7 +15,7 @@ describe Gitlab::LDAP::Config, lib: true do end it 'raises an error if a unknown provider is used' do - expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(RuntimeError) + expect{ described_class.new 'unknown' }.to raise_error(RuntimeError) end end diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb index b796d8bf076..175ceec44d7 100644 --- a/spec/lib/gitlab/ldap/user_spec.rb +++ b/spec/lib/gitlab/ldap/user_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::LDAP::User, lib: true do - let(:ldap_user) { Gitlab::LDAP::User.new(auth_hash) } +describe Gitlab::LDAP::User do + let(:ldap_user) { described_class.new(auth_hash) } let(:gl_user) { ldap_user.gl_user } let(:info) do { @@ -13,7 +13,7 @@ describe Gitlab::LDAP::User, lib: true do let(:auth_hash) do OmniAuth::AuthHash.new(uid: 'my-uid', provider: 'ldapmain', info: info) end - let(:ldap_user_upper_case) { Gitlab::LDAP::User.new(auth_hash_upper_case) } + let(:ldap_user_upper_case) { described_class.new(auth_hash_upper_case) } let(:info_upper_case) do { name: 'John', diff --git a/spec/lib/gitlab/lfs_token_spec.rb b/spec/lib/gitlab/lfs_token_spec.rb index e9c1163e22a..3a20dad16d0 100644 --- a/spec/lib/gitlab/lfs_token_spec.rb +++ b/spec/lib/gitlab/lfs_token_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::LfsToken, lib: true do +describe Gitlab::LfsToken do describe '#token' do shared_examples 'an LFS token generator' do it 'returns a randomly generated token' do diff --git a/spec/lib/gitlab/markup_helper_spec.rb b/spec/lib/gitlab/markup_helper_spec.rb index 93b91b849f2..09e518ff989 100644 --- a/spec/lib/gitlab/markup_helper_spec.rb +++ b/spec/lib/gitlab/markup_helper_spec.rb @@ -1,40 +1,40 @@ require 'spec_helper' -describe Gitlab::MarkupHelper, lib: true do +describe Gitlab::MarkupHelper do describe '#markup?' do %w(textile rdoc org creole wiki mediawiki rst adoc ad asciidoc mdown md markdown).each do |type| it "returns true for #{type} files" do - expect(Gitlab::MarkupHelper.markup?("README.#{type}")).to be_truthy + expect(described_class.markup?("README.#{type}")).to be_truthy end end it 'returns false when given a non-markup filename' do - expect(Gitlab::MarkupHelper.markup?('README.rb')).not_to be_truthy + expect(described_class.markup?('README.rb')).not_to be_truthy end end describe '#gitlab_markdown?' do %w(mdown mkd mkdn md markdown).each do |type| it "returns true for #{type} files" do - expect(Gitlab::MarkupHelper.gitlab_markdown?("README.#{type}")).to be_truthy + expect(described_class.gitlab_markdown?("README.#{type}")).to be_truthy end end it 'returns false when given a non-markdown filename' do - expect(Gitlab::MarkupHelper.gitlab_markdown?('README.rb')).not_to be_truthy + expect(described_class.gitlab_markdown?('README.rb')).not_to be_truthy end end describe '#asciidoc?' do %w(adoc ad asciidoc ADOC).each do |type| it "returns true for #{type} files" do - expect(Gitlab::MarkupHelper.asciidoc?("README.#{type}")).to be_truthy + expect(described_class.asciidoc?("README.#{type}")).to be_truthy end end it 'returns false when given a non-asciidoc filename' do - expect(Gitlab::MarkupHelper.asciidoc?('README.rb')).not_to be_truthy + expect(described_class.asciidoc?('README.rb')).not_to be_truthy end end end diff --git a/spec/lib/gitlab/middleware/go_spec.rb b/spec/lib/gitlab/middleware/go_spec.rb index c2ab015d5cb..6af1564da19 100644 --- a/spec/lib/gitlab/middleware/go_spec.rb +++ b/spec/lib/gitlab/middleware/go_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Middleware::Go, lib: true do +describe Gitlab::Middleware::Go do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } diff --git a/spec/lib/gitlab/o_auth/auth_hash_spec.rb b/spec/lib/gitlab/o_auth/auth_hash_spec.rb index 19ab17419fc..d5f4da3ce36 100644 --- a/spec/lib/gitlab/o_auth/auth_hash_spec.rb +++ b/spec/lib/gitlab/o_auth/auth_hash_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' -describe Gitlab::OAuth::AuthHash, lib: true do +describe Gitlab::OAuth::AuthHash do let(:auth_hash) do - Gitlab::OAuth::AuthHash.new( + described_class.new( OmniAuth::AuthHash.new( provider: provider_ascii, uid: uid_ascii, diff --git a/spec/lib/gitlab/o_auth/provider_spec.rb b/spec/lib/gitlab/o_auth/provider_spec.rb index 1e2a1f8c039..30faf107e3f 100644 --- a/spec/lib/gitlab/o_auth/provider_spec.rb +++ b/spec/lib/gitlab/o_auth/provider_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::OAuth::Provider, lib: true do +describe Gitlab::OAuth::Provider do describe '#config_for' do context 'for an LDAP provider' do context 'when the provider exists' do diff --git a/spec/lib/gitlab/o_auth/user_spec.rb b/spec/lib/gitlab/o_auth/user_spec.rb index ea29cb9caf1..47aa19d5fd9 100644 --- a/spec/lib/gitlab/o_auth/user_spec.rb +++ b/spec/lib/gitlab/o_auth/user_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::OAuth::User, lib: true do - let(:oauth_user) { Gitlab::OAuth::User.new(auth_hash) } +describe Gitlab::OAuth::User do + let(:oauth_user) { described_class.new(auth_hash) } let(:gl_user) { oauth_user.gl_user } let(:uid) { 'my-uid' } let(:provider) { 'my-provider' } diff --git a/spec/lib/gitlab/optimistic_locking_spec.rb b/spec/lib/gitlab/optimistic_locking_spec.rb index acce2be93f2..81f81d4f963 100644 --- a/spec/lib/gitlab/optimistic_locking_spec.rb +++ b/spec/lib/gitlab/optimistic_locking_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::OptimisticLocking, lib: true do +describe Gitlab::OptimisticLocking do let!(:pipeline) { create(:ci_pipeline) } let!(:pipeline2) { Ci::Pipeline.find(pipeline.id) } diff --git a/spec/lib/gitlab/other_markup_spec.rb b/spec/lib/gitlab/other_markup_spec.rb index c0f5fa9dc1f..e26f39e193e 100644 --- a/spec/lib/gitlab/other_markup_spec.rb +++ b/spec/lib/gitlab/other_markup_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::OtherMarkup, lib: true do +describe Gitlab::OtherMarkup do let(:context) { {} } context "XSS Checks" do diff --git a/spec/lib/gitlab/path_regex_spec.rb b/spec/lib/gitlab/path_regex_spec.rb index 20be743d224..2f989397f7e 100644 --- a/spec/lib/gitlab/path_regex_spec.rb +++ b/spec/lib/gitlab/path_regex_spec.rb @@ -1,7 +1,7 @@ # coding: utf-8 require 'spec_helper' -describe Gitlab::PathRegex, lib: true do +describe Gitlab::PathRegex do # Pass in a full path to remove the format segment: # `/ci/lint(.:format)` -> `/ci/lint` def without_format(path) diff --git a/spec/lib/gitlab/polling_interval_spec.rb b/spec/lib/gitlab/polling_interval_spec.rb index 5ea8ecb1c30..eb8e618156b 100644 --- a/spec/lib/gitlab/polling_interval_spec.rb +++ b/spec/lib/gitlab/polling_interval_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::PollingInterval, lib: true do +describe Gitlab::PollingInterval do let(:polling_interval) { described_class } describe '.set_header' do diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb index af50ecdb2ab..4567f220c11 100644 --- a/spec/lib/gitlab/popen_spec.rb +++ b/spec/lib/gitlab/popen_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Gitlab::Popen', lib: true, no_db: true do +describe 'Gitlab::Popen' do let(:path) { Rails.root.join('tmp').to_s } before do diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb index 3d22784909d..d17b436b910 100644 --- a/spec/lib/gitlab/project_search_results_spec.rb +++ b/spec/lib/gitlab/project_search_results_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::ProjectSearchResults, lib: true do +describe Gitlab::ProjectSearchResults do let(:user) { create(:user) } let(:project) { create(:empty_project) } let(:query) { 'hello world' } diff --git a/spec/lib/gitlab/project_transfer_spec.rb b/spec/lib/gitlab/project_transfer_spec.rb index e2d6b1b9ab7..10c5fb148cd 100644 --- a/spec/lib/gitlab/project_transfer_spec.rb +++ b/spec/lib/gitlab/project_transfer_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -describe Gitlab::ProjectTransfer, lib: true do +describe Gitlab::ProjectTransfer do before do @root_dir = File.join(Rails.root, "public", "uploads") - @project_transfer = Gitlab::ProjectTransfer.new + @project_transfer = described_class.new allow(@project_transfer).to receive(:root_dir).and_return(@root_dir) @project_path_was = "test_project_was" diff --git a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb index 61d48b05454..d7df4e35c31 100644 --- a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb +++ b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Prometheus::AdditionalMetricsParser, lib: true do +describe Gitlab::Prometheus::AdditionalMetricsParser do include Prometheus::MetricBuilders let(:parser_error_class) { Gitlab::Prometheus::ParsingError } diff --git a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb index 4909aec5a4d..e42e034f4fb 100644 --- a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::AdditionalMetricsDeploymentQuery, lib: true do +describe Gitlab::Prometheus::Queries::AdditionalMetricsDeploymentQuery do include Prometheus::MetricBuilders let(:client) { double('prometheus_client') } diff --git a/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb index 8e6e3bb5946..e9fd66d45fe 100644 --- a/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::AdditionalMetricsEnvironmentQuery, lib: true do +describe Gitlab::Prometheus::Queries::AdditionalMetricsEnvironmentQuery do include Prometheus::MetricBuilders let(:client) { double('prometheus_client') } diff --git a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb index d957dd932c4..ffe3ad85baa 100644 --- a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::DeploymentQuery, lib: true do +describe Gitlab::Prometheus::Queries::DeploymentQuery do let(:environment) { create(:environment, slug: 'environment-slug') } let(:deployment) { create(:deployment, environment: environment) } diff --git a/spec/lib/gitlab/prometheus/queries/matched_metrics_query_spec.rb b/spec/lib/gitlab/prometheus/queries/matched_metrics_query_spec.rb index d2796ab72da..2b488101496 100644 --- a/spec/lib/gitlab/prometheus/queries/matched_metrics_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/matched_metrics_query_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::MatchedMetricsQuery, lib: true do +describe Gitlab::Prometheus::Queries::MatchedMetricsQuery do include Prometheus::MetricBuilders let(:metric_group_class) { Gitlab::Prometheus::MetricGroup } diff --git a/spec/lib/gitlab/prometheus_client_spec.rb b/spec/lib/gitlab/prometheus_client_spec.rb index 46eaadae206..de625324092 100644 --- a/spec/lib/gitlab/prometheus_client_spec.rb +++ b/spec/lib/gitlab/prometheus_client_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::PrometheusClient, lib: true do +describe Gitlab::PrometheusClient do include PrometheusHelpers subject { described_class.new(api_url: 'https://prometheus.example.com') } diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index 917692e9c6c..1a0357534f2 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' -describe Gitlab::ReferenceExtractor, lib: true do +describe Gitlab::ReferenceExtractor do let(:project) { create(:empty_project) } before do project.team << [project.creator, :developer] end - subject { Gitlab::ReferenceExtractor.new(project, project.creator) } + subject { described_class.new(project, project.creator) } it 'accesses valid user objects' do @u_foo = create(:user, username: 'foo') diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 251f82849bf..68a57826647 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -1,7 +1,7 @@ # coding: utf-8 require 'spec_helper' -describe Gitlab::Regex, lib: true do +describe Gitlab::Regex do describe '.project_name_regex' do subject { described_class.project_name_regex } diff --git a/spec/lib/gitlab/request_context_spec.rb b/spec/lib/gitlab/request_context_spec.rb index a91c8655cdd..e272bdb9284 100644 --- a/spec/lib/gitlab/request_context_spec.rb +++ b/spec/lib/gitlab/request_context_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' -describe Gitlab::RequestContext, lib: true do +describe Gitlab::RequestContext do describe '#client_ip' do - subject { Gitlab::RequestContext.client_ip } + subject { described_class.client_ip } let(:app) { -> (env) {} } let(:env) { Hash.new } @@ -16,7 +16,7 @@ describe Gitlab::RequestContext, lib: true do before do allow_any_instance_of(Rack::Request).to receive(:ip).and_return(ip) - Gitlab::RequestContext.new(app).call(env) + described_class.new(app).call(env) end it { is_expected.to eq(ip) } diff --git a/spec/lib/gitlab/request_profiler_spec.rb b/spec/lib/gitlab/request_profiler_spec.rb index ae9c06ebb7d..fd8cbf39bce 100644 --- a/spec/lib/gitlab/request_profiler_spec.rb +++ b/spec/lib/gitlab/request_profiler_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::RequestProfiler, lib: true do +describe Gitlab::RequestProfiler do describe '.profile_token' do it 'returns a token' do expect(described_class.profile_token).to be_present diff --git a/spec/lib/gitlab/route_map_spec.rb b/spec/lib/gitlab/route_map_spec.rb index e8feb21e4d7..d672f7b5675 100644 --- a/spec/lib/gitlab/route_map_spec.rb +++ b/spec/lib/gitlab/route_map_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::RouteMap, lib: true do +describe Gitlab::RouteMap do describe '#initialize' do context 'when the data is not YAML' do it 'raises an error' do diff --git a/spec/lib/gitlab/saml/user_spec.rb b/spec/lib/gitlab/saml/user_spec.rb index a4d2367b72a..2827a18515e 100644 --- a/spec/lib/gitlab/saml/user_spec.rb +++ b/spec/lib/gitlab/saml/user_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Saml::User, lib: true do +describe Gitlab::Saml::User do let(:saml_user) { described_class.new(auth_hash) } let(:gl_user) { saml_user.gl_user } let(:uid) { 'my-uid' } diff --git a/spec/lib/gitlab/shell_spec.rb b/spec/lib/gitlab/shell_spec.rb index 5b1b8f9516a..b90d8dede0f 100644 --- a/spec/lib/gitlab/shell_spec.rb +++ b/spec/lib/gitlab/shell_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' require 'stringio' -describe Gitlab::Shell, lib: true do +describe Gitlab::Shell do let(:project) { double('Project', id: 7, path: 'diaspora') } - let(:gitlab_shell) { Gitlab::Shell.new } + let(:gitlab_shell) { described_class.new } let(:popen_vars) { { 'GIT_TERMINAL_PROMPT' => ENV['GIT_TERMINAL_PROMPT'] } } before do @@ -30,7 +30,7 @@ describe Gitlab::Shell, lib: true do allow(Gitlab.config.gitlab_shell).to receive(:secret_file).and_return(secret_file) allow(Gitlab.config.gitlab_shell).to receive(:path).and_return('tmp/tests/shell-secret-test') FileUtils.mkdir('tmp/tests/shell-secret-test') - Gitlab::Shell.ensure_secret_token! + described_class.ensure_secret_token! end after do @@ -39,7 +39,7 @@ describe Gitlab::Shell, lib: true do end it 'creates and links the secret token file' do - secret_token = Gitlab::Shell.secret_token + secret_token = described_class.secret_token expect(File.exist?(secret_file)).to be(true) expect(File.read(secret_file).chomp).to eq(secret_token) @@ -59,7 +59,7 @@ describe Gitlab::Shell, lib: true do end end - describe Gitlab::Shell::KeyAdder, lib: true do + describe Gitlab::Shell::KeyAdder do describe '#add_key' do it 'removes trailing garbage' do io = spy(:io) diff --git a/spec/lib/gitlab/sherlock/collection_spec.rb b/spec/lib/gitlab/sherlock/collection_spec.rb index 2ae79b50e77..873ed14f804 100644 --- a/spec/lib/gitlab/sherlock/collection_spec.rb +++ b/spec/lib/gitlab/sherlock/collection_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::Collection, lib: true do +describe Gitlab::Sherlock::Collection do let(:collection) { described_class.new } let(:transaction) do diff --git a/spec/lib/gitlab/sherlock/file_sample_spec.rb b/spec/lib/gitlab/sherlock/file_sample_spec.rb index 4989d14def3..394421504e0 100644 --- a/spec/lib/gitlab/sherlock/file_sample_spec.rb +++ b/spec/lib/gitlab/sherlock/file_sample_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::FileSample, lib: true do +describe Gitlab::Sherlock::FileSample do let(:sample) { described_class.new(__FILE__, [], 150.4, 2) } describe '#id' do diff --git a/spec/lib/gitlab/sherlock/line_profiler_spec.rb b/spec/lib/gitlab/sherlock/line_profiler_spec.rb index 39c6b2a4844..f2f8040fa0b 100644 --- a/spec/lib/gitlab/sherlock/line_profiler_spec.rb +++ b/spec/lib/gitlab/sherlock/line_profiler_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::LineProfiler, lib: true do +describe Gitlab::Sherlock::LineProfiler do let(:profiler) { described_class.new } describe '#profile' do diff --git a/spec/lib/gitlab/sherlock/line_sample_spec.rb b/spec/lib/gitlab/sherlock/line_sample_spec.rb index f9b61f8684e..5f02f6a3213 100644 --- a/spec/lib/gitlab/sherlock/line_sample_spec.rb +++ b/spec/lib/gitlab/sherlock/line_sample_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::LineSample, lib: true do +describe Gitlab::Sherlock::LineSample do let(:sample) { described_class.new(150.0, 4) } describe '#duration' do diff --git a/spec/lib/gitlab/sherlock/location_spec.rb b/spec/lib/gitlab/sherlock/location_spec.rb index 5739afa6b1e..b295a624b35 100644 --- a/spec/lib/gitlab/sherlock/location_spec.rb +++ b/spec/lib/gitlab/sherlock/location_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::Location, lib: true do +describe Gitlab::Sherlock::Location do let(:location) { described_class.new(__FILE__, 1) } describe 'from_ruby_location' do diff --git a/spec/lib/gitlab/sherlock/middleware_spec.rb b/spec/lib/gitlab/sherlock/middleware_spec.rb index b98ab0b14a2..2016023df06 100644 --- a/spec/lib/gitlab/sherlock/middleware_spec.rb +++ b/spec/lib/gitlab/sherlock/middleware_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::Middleware, lib: true do +describe Gitlab::Sherlock::Middleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } diff --git a/spec/lib/gitlab/sherlock/query_spec.rb b/spec/lib/gitlab/sherlock/query_spec.rb index d97b5eef573..426071c7f92 100644 --- a/spec/lib/gitlab/sherlock/query_spec.rb +++ b/spec/lib/gitlab/sherlock/query_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::Query, lib: true do +describe Gitlab::Sherlock::Query do let(:started_at) { Time.utc(2015, 1, 1) } let(:finished_at) { started_at + 5 } diff --git a/spec/lib/gitlab/sherlock/transaction_spec.rb b/spec/lib/gitlab/sherlock/transaction_spec.rb index 6ae1aa20ea7..4a14dfbec56 100644 --- a/spec/lib/gitlab/sherlock/transaction_spec.rb +++ b/spec/lib/gitlab/sherlock/transaction_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Sherlock::Transaction, lib: true do +describe Gitlab::Sherlock::Transaction do let(:transaction) { described_class.new('POST', '/cat_pictures') } describe '#id' do diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb index 28d7f9858c3..f0ecf59406a 100644 --- a/spec/lib/gitlab/slash_commands/command_spec.rb +++ b/spec/lib/gitlab/slash_commands/command_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Command, service: true do +describe Gitlab::SlashCommands::Command do let(:project) { create(:empty_project) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/deploy_spec.rb b/spec/lib/gitlab/slash_commands/deploy_spec.rb index d919f7260db..e52aaed7328 100644 --- a/spec/lib/gitlab/slash_commands/deploy_spec.rb +++ b/spec/lib/gitlab/slash_commands/deploy_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Deploy, service: true do +describe Gitlab::SlashCommands::Deploy do describe '#execute' do let(:project) { create(:empty_project) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/issue_new_spec.rb b/spec/lib/gitlab/slash_commands/issue_new_spec.rb index 4de50d4a8bb..5dfb1b506bc 100644 --- a/spec/lib/gitlab/slash_commands/issue_new_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_new_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueNew, service: true do +describe Gitlab::SlashCommands::IssueNew do describe '#execute' do let(:project) { create(:empty_project) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/issue_search_spec.rb b/spec/lib/gitlab/slash_commands/issue_search_spec.rb index 06fff0afc50..e5409fe2339 100644 --- a/spec/lib/gitlab/slash_commands/issue_search_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_search_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueSearch, service: true do +describe Gitlab::SlashCommands::IssueSearch do describe '#execute' do let!(:issue) { create(:issue, project: project, title: 'find me') } let!(:confidential) { create(:issue, :confidential, project: project, title: 'mepmep find') } diff --git a/spec/lib/gitlab/slash_commands/issue_show_spec.rb b/spec/lib/gitlab/slash_commands/issue_show_spec.rb index 1899f664ccd..f67a17c7922 100644 --- a/spec/lib/gitlab/slash_commands/issue_show_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_show_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueShow, service: true do +describe Gitlab::SlashCommands::IssueShow do describe '#execute' do let(:issue) { create(:issue, project: project) } let(:project) { create(:empty_project) } diff --git a/spec/lib/gitlab/sql/glob_spec.rb b/spec/lib/gitlab/sql/glob_spec.rb index 451c583310d..f0bb4294d62 100644 --- a/spec/lib/gitlab/sql/glob_spec.rb +++ b/spec/lib/gitlab/sql/glob_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SQL::Glob, lib: true do +describe Gitlab::SQL::Glob do describe '.to_like' do it 'matches * as %' do expect(glob('apple', '*')).to be(true) diff --git a/spec/lib/gitlab/sql/union_spec.rb b/spec/lib/gitlab/sql/union_spec.rb index 849edb09476..5346881444d 100644 --- a/spec/lib/gitlab/sql/union_spec.rb +++ b/spec/lib/gitlab/sql/union_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::SQL::Union, lib: true do +describe Gitlab::SQL::Union do let(:relation_1) { User.where(email: 'alice@example.com').select(:id) } let(:relation_2) { User.where(email: 'bob@example.com').select(:id) } diff --git a/spec/lib/gitlab/string_range_marker_spec.rb b/spec/lib/gitlab/string_range_marker_spec.rb index 7c77772b3f6..abeaa7f0ddb 100644 --- a/spec/lib/gitlab/string_range_marker_spec.rb +++ b/spec/lib/gitlab/string_range_marker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::StringRangeMarker, lib: true do +describe Gitlab::StringRangeMarker do describe '#mark' do context "when the rich text is html safe" do let(:raw) { "abc <def>" } diff --git a/spec/lib/gitlab/string_regex_marker_spec.rb b/spec/lib/gitlab/string_regex_marker_spec.rb index 2f5cf6c6e3b..d715f9bd641 100644 --- a/spec/lib/gitlab/string_regex_marker_spec.rb +++ b/spec/lib/gitlab/string_regex_marker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::StringRegexMarker, lib: true do +describe Gitlab::StringRegexMarker do describe '#mark' do let(:raw) { %{"name": "AFNetworking"} } let(:rich) { %{<span class="key">"name"</span><span class="punctuation">: </span><span class="value">"AFNetworking"</span>}.html_safe } diff --git a/spec/lib/gitlab/upgrader_spec.rb b/spec/lib/gitlab/upgrader_spec.rb index fcfd8d58b70..6106f13c774 100644 --- a/spec/lib/gitlab/upgrader_spec.rb +++ b/spec/lib/gitlab/upgrader_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::Upgrader, lib: true do - let(:upgrader) { Gitlab::Upgrader.new } +describe Gitlab::Upgrader do + let(:upgrader) { described_class.new } let(:current_version) { Gitlab::VERSION } describe 'current_version_raw' do diff --git a/spec/lib/gitlab/url_blocker_spec.rb b/spec/lib/gitlab/url_blocker_spec.rb index a504d299307..f5b4882815f 100644 --- a/spec/lib/gitlab/url_blocker_spec.rb +++ b/spec/lib/gitlab/url_blocker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::UrlBlocker, lib: true do +describe Gitlab::UrlBlocker do describe '#blocked_url?' do it 'allows imports from configured web host and port' do import_url = "http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/t.git" diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index e9a6e273516..50422020823 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::UrlBuilder, lib: true do +describe Gitlab::UrlBuilder do describe '.build' do context 'when passing a Commit' do it 'returns a proper URL' do diff --git a/spec/lib/gitlab/url_sanitizer_spec.rb b/spec/lib/gitlab/url_sanitizer_spec.rb index 6bce724a3f6..308b1a128be 100644 --- a/spec/lib/gitlab/url_sanitizer_spec.rb +++ b/spec/lib/gitlab/url_sanitizer_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::UrlSanitizer, lib: true do +describe Gitlab::UrlSanitizer do let(:credentials) { { user: 'blah', password: 'password' } } let(:url_sanitizer) do described_class.new("https://github.com/me/project.git", credentials: credentials) diff --git a/spec/lib/gitlab/user_access_spec.rb b/spec/lib/gitlab/user_access_spec.rb index 0d87cf25dbb..5ebaf6c1507 100644 --- a/spec/lib/gitlab/user_access_spec.rb +++ b/spec/lib/gitlab/user_access_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -describe Gitlab::UserAccess, lib: true do - let(:access) { Gitlab::UserAccess.new(user, project: project) } +describe Gitlab::UserAccess do + let(:access) { described_class.new(user, project: project) } let(:project) { create(:project) } let(:user) { create(:user) } @@ -28,7 +28,7 @@ describe Gitlab::UserAccess, lib: true do describe 'push to empty project' do let(:empty_project) { create(:project_empty_repo) } - let(:project_access) { Gitlab::UserAccess.new(user, project: empty_project) } + let(:project_access) { described_class.new(user, project: empty_project) } it 'returns true if user is master' do empty_project.team << [user, :master] diff --git a/spec/lib/gitlab/user_activities_spec.rb b/spec/lib/gitlab/user_activities_spec.rb index a4ea0ac59e9..6bce2ee13cf 100644 --- a/spec/lib/gitlab/user_activities_spec.rb +++ b/spec/lib/gitlab/user_activities_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::UserActivities, :clean_gitlab_redis_shared_state, lib: true do +describe Gitlab::UserActivities, :clean_gitlab_redis_shared_state do let(:now) { Time.now } describe '.record' do diff --git a/spec/lib/gitlab/utils_spec.rb b/spec/lib/gitlab/utils_spec.rb index 00941aec380..111c873f79c 100644 --- a/spec/lib/gitlab/utils_spec.rb +++ b/spec/lib/gitlab/utils_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Utils, lib: true do +describe Gitlab::Utils do delegate :to_boolean, :boolean_to_yes_no, to: :described_class describe '.to_boolean' do diff --git a/spec/lib/gitlab/version_info_spec.rb b/spec/lib/gitlab/version_info_spec.rb index 706ee9bec58..e7e1a92ae54 100644 --- a/spec/lib/gitlab/version_info_spec.rb +++ b/spec/lib/gitlab/version_info_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Gitlab::VersionInfo', lib: true, no_db: true do +describe 'Gitlab::VersionInfo' do before do @unknown = Gitlab::VersionInfo.new @v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1) diff --git a/spec/lib/gitlab/visibility_level_spec.rb b/spec/lib/gitlab/visibility_level_spec.rb index db9d2807be6..48a67773de9 100644 --- a/spec/lib/gitlab/visibility_level_spec.rb +++ b/spec/lib/gitlab/visibility_level_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::VisibilityLevel, lib: true do +describe Gitlab::VisibilityLevel do describe '.level_value' do it 'converts "public" to integer value' do expect(described_class.level_value('public')).to eq(Gitlab::VisibilityLevel::PUBLIC) diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index 6ca1edb01b9..654397ccffb 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Workhorse, lib: true do +describe Gitlab::Workhorse do let(:project) { create(:project, :repository) } let(:repository) { project.repository } @@ -63,13 +63,13 @@ describe Gitlab::Workhorse, lib: true do end context 'without ca_pem' do - subject { Gitlab::Workhorse.terminal_websocket(terminal) } + subject { described_class.terminal_websocket(terminal) } it { is_expected.to eq(workhorse) } end context 'with ca_pem' do - subject { Gitlab::Workhorse.terminal_websocket(terminal(ca_pem: "foo")) } + subject { described_class.terminal_websocket(terminal(ca_pem: "foo")) } it { is_expected.to eq(workhorse(ca_pem: "foo")) } end |