Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2022-05-17 01:35:40 +0300
committerEvan Read <eread@gitlab.com>2022-05-18 11:03:12 +0300
commit322b85ed214020c3f8f03148a13e3bc6db5f5e64 (patch)
treeb31a2e6ae8a82acd579ebf7cc7df50295d2f3530 /spec/gitlab
parentce463be3c1aec9242d071745d80dc027cae8cf5f (diff)
Fix RSpec/VerifiedDoubles Rubocop offenses
Diffstat (limited to 'spec/gitlab')
-rw-r--r--spec/gitlab/docs/link_spec.rb8
-rw-r--r--spec/gitlab/navigation_spec.rb6
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/gitlab/docs/link_spec.rb b/spec/gitlab/docs/link_spec.rb
index 18878be9..4484936e 100644
--- a/spec/gitlab/docs/link_spec.rb
+++ b/spec/gitlab/docs/link_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
describe Gitlab::Docs::Link do
- let(:page) { double('page') }
+ let(:page) { instance_double(Gitlab::Docs::Page) }
let(:href) { '../some/page.html#some-anchor' }
subject { described_class.new(href, page) }
@@ -98,7 +98,7 @@ describe Gitlab::Docs::Link do
context 'when the link is an external link' do
let(:href) { '../some/page.html#my-anchor' }
- let(:destination) { double('destination') }
+ let(:destination) { instance_double(Gitlab::Docs::Page) }
before do
allow(page).to receive(:directory).and_return('/my/docs/page')
@@ -126,7 +126,7 @@ describe Gitlab::Docs::Link do
before do
allow(page).to receive(:directory).and_return('/my/dir')
allow(subject).to receive(:destination_file)
- .and_return(double('page', exists?: false))
+ .and_return(instance_double(Gitlab::Docs::Page, exists?: false))
end
it 'returns false if page does not exist' do
@@ -138,7 +138,7 @@ describe Gitlab::Docs::Link do
before do
allow(page).to receive(:directory).and_return('/my/dir')
allow(subject).to receive(:destination_file)
- .and_return(double('page', has_anchor?: false))
+ .and_return(instance_double(Gitlab::Docs::Page, has_anchor?: false))
end
it 'returns false if anchor does not exist' do
diff --git a/spec/gitlab/navigation_spec.rb b/spec/gitlab/navigation_spec.rb
index 892d4486..36e1b132 100644
--- a/spec/gitlab/navigation_spec.rb
+++ b/spec/gitlab/navigation_spec.rb
@@ -8,7 +8,7 @@ require 'gitlab/navigation/section'
describe Gitlab::Navigation do
subject(:navigation) { described_class.new(items, item) }
- let(:item) { double(path: '/omnibus/user/README.html', identifier: double(to_s: '/omnibus/user/README.md')) }
+ let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/omnibus/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/omnibus/user/README.md')) }
let(:items) do
{
'/_data/navigation.yaml' => { sections: [Gitlab::Navigation::Section.new(section_title: 'Default Section')] }
@@ -19,7 +19,7 @@ describe Gitlab::Navigation do
subject { navigation.nav_items }
context 'when yaml configuration for project does not exist' do
- let(:item) { double(path: '/ee/user/README.html', identifier: double(to_s: '/ee/user/README.md')) }
+ let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/ee/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/ee/user/README.md')) }
it 'returns default sections' do
sections = subject[:sections]
@@ -39,7 +39,7 @@ describe Gitlab::Navigation do
it { is_expected.to eq('/omnibus/user/README.html') }
context 'when yaml configuration for project does not exist' do
- let(:item) { double(path: '/ee/user/README.html', identifier: double(to_s: '/ee/user/README.md')) }
+ let(:item) { instance_double(Nanoc::Core::CompilationItemView, path: '/ee/user/README.html', identifier: instance_double(Nanoc::Core::Identifier, to_s: '/ee/user/README.md')) }
it { is_expected.to eq('/omnibus/user/README.html') }
end