Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a1b288e2
Commit
a1b288e2
authored
May 19, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'leaky-constant-fix-16' into 'master'
Stub class in tree spec See merge request gitlab-org/gitlab!32045
parents
e6442cb3
56f3375d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-16.yml
changelogs/unreleased/leaky-constant-fix-16.yml
+5
-0
spec/models/tree_spec.rb
spec/models/tree_spec.rb
+12
-9
No files found.
.rubocop.yml
View file @
a1b288e2
...
...
@@ -387,7 +387,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/models/concerns/reactive_caching_spec.rb'
-
'
spec/models/concerns/triggerable_hooks_spec.rb'
-
'
spec/models/repository_spec.rb'
-
'
spec/models/tree_spec.rb'
-
'
spec/policies/merge_request_policy_spec.rb'
-
'
spec/requests/api/graphql/tasks/task_completion_status_spec.rb'
-
'
spec/rubocop/cop/rspec/env_assignment_spec.rb'
...
...
changelogs/unreleased/leaky-constant-fix-16.yml
0 → 100644
View file @
a1b288e2
---
title
:
Fix leaky constant issue in tree spec
merge_request
:
32045
author
:
Rajendra Kadam
type
:
fixed
spec/models/tree_spec.rb
View file @
a1b288e2
...
...
@@ -9,15 +9,18 @@ describe Tree do
subject
{
described_class
.
new
(
repository
,
'54fcc214'
)
}
describe
'#readme'
do
class
FakeBlob
attr_reader
:name
def
initialize
(
name
)
@name
=
name
end
def
readme?
name
=~
/^readme/i
before
do
stub_const
(
'FakeBlob'
,
Class
.
new
)
FakeBlob
.
class_eval
do
attr_reader
:name
def
initialize
(
name
)
@name
=
name
end
def
readme?
name
=~
/^readme/i
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment