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
ba70e50e
Commit
ba70e50e
authored
Feb 23, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds specs for pipeline expressions raw token
parent
227e18ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
spec/lib/gitlab/ci/pipeline/expression/token_spec.rb
spec/lib/gitlab/ci/pipeline/expression/token_spec.rb
+45
-0
No files found.
spec/lib/gitlab/ci/pipeline/expression/token_spec.rb
0 → 100644
View file @
ba70e50e
require
'spec_helper'
describe
Gitlab
::
Ci
::
Pipeline
::
Expression
::
Token
do
let
(
:value
)
{
'$VARIABLE'
}
let
(
:lexeme
)
{
Gitlab
::
Ci
::
Pipeline
::
Expression
::
Lexeme
::
Variable
}
subject
{
described_class
.
new
(
value
,
lexeme
)
}
describe
'#value'
do
it
'returns raw token value'
do
expect
(
subject
.
value
).
to
eq
value
end
end
describe
'#lexeme'
do
it
'returns raw token lexeme'
do
expect
(
subject
.
lexeme
).
to
eq
lexeme
end
end
describe
'#build'
do
it
'delegates to lexeme after adding a value'
do
expect
(
lexeme
).
to
receive
(
:build
)
.
with
(
value
,
'some'
,
'args'
)
subject
.
build
(
'some'
,
'args'
)
end
it
'allows passing only required arguments'
do
expect
(
subject
.
build
).
to
be_an_instance_of
(
lexeme
)
end
end
describe
'#type'
do
it
'delegates type query to the lexeme'
do
expect
(
subject
.
type
).
to
eq
:value
end
end
describe
'#to_lexeme'
do
it
'returns raw lexeme syntax component name'
do
expect
(
subject
.
to_lexeme
).
to
eq
'variable'
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