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
75232f92
Commit
75232f92
authored
Nov 22, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark proxy_class_name as private
Add spec for repository proxying
parent
8ab995da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
0 deletions
+36
-0
ee/lib/elastic/multi_version_class_proxy.rb
ee/lib/elastic/multi_version_class_proxy.rb
+2
-0
ee/lib/elastic/multi_version_instance_proxy.rb
ee/lib/elastic/multi_version_instance_proxy.rb
+2
-0
ee/spec/lib/elastic/multi_version_class_proxy_spec.rb
ee/spec/lib/elastic/multi_version_class_proxy_spec.rb
+14
-0
ee/spec/lib/elastic/multi_version_instance_proxy_spec.rb
ee/spec/lib/elastic/multi_version_instance_proxy_spec.rb
+18
-0
No files found.
ee/lib/elastic/multi_version_class_proxy.rb
View file @
75232f92
...
...
@@ -19,6 +19,8 @@ module Elastic
end
end
private
def
proxy_class_name
"
#{
@data_class
.
name
}
ClassProxy"
end
...
...
ee/lib/elastic/multi_version_instance_proxy.rb
View file @
75232f92
...
...
@@ -12,6 +12,8 @@ module Elastic
generate_forwarding
end
private
def
proxy_class_name
"
#{
@data_class
.
name
}
InstanceProxy"
end
...
...
ee/spec/lib/elastic/multi_version_class_proxy_spec.rb
View file @
75232f92
...
...
@@ -12,6 +12,20 @@ describe Elastic::MultiVersionClassProxy do
expect
(
result
).
to
be_a
(
Elastic
::
V12p1
::
SnippetClassProxy
)
expect
(
result
.
target
).
to
eq
(
ProjectSnippet
)
end
context
'repository'
do
it
'returns class proxy in specified version'
do
repository_proxy
=
described_class
.
new
(
Repository
)
repository_result
=
repository_proxy
.
version
(
'V12p1'
)
wiki_proxy
=
described_class
.
new
(
ProjectWiki
)
wiki_result
=
wiki_proxy
.
version
(
'V12p1'
)
expect
(
repository_result
).
to
be_a
(
Elastic
::
V12p1
::
RepositoryClassProxy
)
expect
(
repository_result
.
target
).
to
eq
(
Repository
)
expect
(
wiki_result
).
to
be_a
(
Elastic
::
V12p1
::
ProjectWikiClassProxy
)
expect
(
wiki_result
.
target
).
to
eq
(
ProjectWiki
)
end
end
end
describe
'method forwarding'
do
...
...
ee/spec/lib/elastic/multi_version_instance_proxy_spec.rb
View file @
75232f92
...
...
@@ -14,6 +14,24 @@ describe Elastic::MultiVersionInstanceProxy do
expect
(
result
).
to
be_a
(
Elastic
::
V12p1
::
SnippetInstanceProxy
)
expect
(
result
.
target
).
to
eq
(
snippet
)
end
context
'repository'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:wiki
)
{
project
.
wiki
}
it
'returns instance proxy in specified version'
do
repository_proxy
=
described_class
.
new
(
repository
)
repository_result
=
repository_proxy
.
version
(
'V12p1'
)
wiki_proxy
=
described_class
.
new
(
wiki
)
wiki_result
=
wiki_proxy
.
version
(
'V12p1'
)
expect
(
repository_result
).
to
be_a
(
Elastic
::
V12p1
::
RepositoryInstanceProxy
)
expect
(
repository_result
.
target
).
to
eq
(
repository
)
expect
(
wiki_result
).
to
be_a
(
Elastic
::
V12p1
::
ProjectWikiInstanceProxy
)
expect
(
wiki_result
.
target
).
to
eq
(
wiki
)
end
end
end
describe
'method forwarding'
do
...
...
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