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
d7f87a2b
Commit
d7f87a2b
authored
Aug 30, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Absorb the old tests
parent
517ee9fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
spec/lib/gitlab/patch/prependable_spec.rb
spec/lib/gitlab/patch/prependable_spec.rb
+50
-0
No files found.
spec/lib/gitlab/patch/prependable_spec.rb
View file @
d7f87a2b
...
@@ -118,4 +118,54 @@ describe Gitlab::Patch::Prependable do
...
@@ -118,4 +118,54 @@ describe Gitlab::Patch::Prependable do
expect
(
prepended_modules
).
to
eq
([[
subject
,
ee
]])
expect
(
prepended_modules
).
to
eq
([[
subject
,
ee
]])
end
end
end
end
describe
'simple case'
do
subject
do
foo_
=
foo
Class
.
new
do
prepend
foo_
def
value
10
end
end
end
let
(
:foo
)
do
Module
.
new
do
extend
ActiveSupport
::
Concern
prepended
do
def
self
.
class_value
20
end
end
def
value
super
*
10
end
end
end
context
'class methods'
do
it
"has a method"
do
expect
(
subject
).
to
respond_to
(
:class_value
)
end
it
'can execute a method'
do
expect
(
subject
.
class_value
).
to
eq
(
20
)
end
end
context
'instance methods'
do
it
"has a method"
do
expect
(
subject
.
new
).
to
respond_to
(
:value
)
end
it
'chains a method execution'
do
expect
(
subject
.
new
.
value
).
to
eq
(
100
)
end
end
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