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
ca16681e
Commit
ca16681e
authored
Jan 19, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a Prependable specs
parent
326fdcbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
spec/lib/prependable_spec.rb
spec/lib/prependable_spec.rb
+47
-0
No files found.
spec/lib/prependable_spec.rb
0 → 100644
View file @
ca16681e
require
'spec_helper'
describe
Prependable
do
subject
{
FooObject
}
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
(
200
)
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
module
Foo
extend
Prependable
prepended
do
def
self
.
class_value
20
end
end
def
value
super
*
10
end
end
class
FooObject
prepend
Foo
def
value
10
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