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
f6327f4e
Commit
f6327f4e
authored
Sep 18, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace double with single quotes for absense of string interpolation
parent
fab7bd77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
lib/gitlab/ci/ansi2json/converter.rb
lib/gitlab/ci/ansi2json/converter.rb
+3
-3
spec/lib/gitlab/ci/ansi2json_spec.rb
spec/lib/gitlab/ci/ansi2json_spec.rb
+7
-7
No files found.
lib/gitlab/ci/ansi2json/converter.rb
View file @
f6327f4e
...
...
@@ -108,9 +108,9 @@ module Gitlab
section_name
=
sanitize_section_name
(
section
)
if
action
==
"start"
if
action
==
'start'
handle_section_start
(
scanner
,
section_name
,
timestamp
,
options
)
elsif
action
==
"end"
elsif
action
==
'end'
handle_section_end
(
scanner
,
section_name
,
timestamp
)
else
raise
'unsupported action'
...
...
@@ -164,7 +164,7 @@ module Gitlab
# We need to remove the square brackets and split
# by comma to get a list of the options
options
=
raw_options
[
1
...-
1
].
split
","
options
=
raw_options
[
1
...-
1
].
split
','
# Now split each option by equals to separate
# each in the format [key, value]
...
...
spec/lib/gitlab/ci/ansi2json_spec.rb
View file @
f6327f4e
...
...
@@ -229,7 +229,7 @@ RSpec.describe Gitlab::Ci::Ansi2json do
expect
(
convert_json
(
trace
)).
to
eq
([
{
offset:
0
,
content:
[{
text:
"section_end:1:2<div>hello</div>"
}],
content:
[{
text:
'section_end:1:2<div>hello</div>'
}],
section:
'prepare-script'
,
section_header:
true
},
...
...
@@ -338,7 +338,7 @@ RSpec.describe Gitlab::Ci::Ansi2json do
expect
(
convert_json
(
trace
)).
to
eq
([
{
offset:
0
,
content:
[{
text:
"hello"
}],
content:
[{
text:
'hello'
}],
section:
'prepare-script'
,
section_header:
true
,
section_options:
{
...
...
@@ -365,7 +365,7 @@ RSpec.describe Gitlab::Ci::Ansi2json do
context
'with split word'
do
let
(
:pre_text
)
{
"
\e
[1mHello "
}
let
(
:text
)
{
"World"
}
let
(
:text
)
{
'World'
}
let
(
:lines
)
do
[
...
...
@@ -381,7 +381,7 @@ RSpec.describe Gitlab::Ci::Ansi2json do
context
'with split word on second line'
do
let
(
:pre_text
)
{
"Good
\n
morning "
}
let
(
:text
)
{
"World"
}
let
(
:text
)
{
'World'
}
let
(
:lines
)
do
[
...
...
@@ -540,7 +540,7 @@ RSpec.describe Gitlab::Ci::Ansi2json do
end
describe
'trucates'
do
let
(
:text
)
{
"Hello World"
}
let
(
:text
)
{
'Hello World'
}
let
(
:stream
)
{
StringIO
.
new
(
text
)
}
let
(
:subject
)
{
described_class
.
convert
(
stream
)
}
...
...
@@ -548,11 +548,11 @@ RSpec.describe Gitlab::Ci::Ansi2json do
stream
.
seek
(
3
,
IO
::
SEEK_SET
)
end
it
"returns truncated output"
do
it
'returns truncated output'
do
expect
(
subject
.
truncated
).
to
be_truthy
end
it
"does not append output"
do
it
'does not append output'
do
expect
(
subject
.
append
).
to
be_falsey
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