Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
0adcf264
Commit
0adcf264
authored
Jan 16, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SpecHelper] Improve support for Bacon.
parent
9dc15fd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
bacon.rb
spec/spec_helper/bacon.rb
+29
-10
No files found.
spec/spec_helper/bacon.rb
View file @
0adcf264
...
...
@@ -75,27 +75,45 @@ module Bacon
# Overrides the TestUnitOutput to provide colored result output.
#
module
TestUnitOutput
# Represents the specifications as `:`.
#
def
handle_specification
(
name
)
print
Bacon
.
color
(
nil
,
':'
)
indicator
=
Bacon
.
color
(
nil
,
':'
)
print
indicator
@indicators
||=
''
@indicators
<<
indicator
yield
end
# Represents the requirements as:
#
# - [.] successful
# - [E] error
# - [F] failure
# - [_] skipped
#
# After the first failure or error all the other requirements are skipped.
#
def
handle_requirement
(
description
,
disabled
=
false
)
if
@first_error
print
Bacon
.
color
(
nil
,
'_'
)
indicator
=
Bacon
.
color
(
nil
,
'_'
)
else
error
=
yield
if
!
error
.
empty?
@first_error
=
true
m
=
error
[
0
..
0
]
c
=
(
m
==
"E"
?
:
red
:
:yellow
)
print
Bacon
.
color
(
c
,
m
)
@first_error
=
true
indicator
=
Bacon
.
color
(
c
,
m
)
elsif
disabled
print
"D"
indicator
=
"D"
else
print
Bacon
.
color
(
nil
,
'.'
)
indicator
=
Bacon
.
color
(
nil
,
'.'
)
end
end
print
indicator
@indicators
||=
''
@indicators
<<
indicator
end
def
handle_summary
...
...
@@ -105,6 +123,9 @@ module Bacon
error_count
+=
1
if
s
.
include?
(
'Error:'
)
||
s
.
include?
(
'Informative'
)
first_error
<<
s
if
error_count
<=
1
end
first_error
=
first_error
.
gsub
(
Dir
.
pwd
+
'/'
,
''
)
first_error
=
first_error
.
gsub
(
/lib\//
,
Bacon
.
color
(
:yellow
,
'lib'
)
+
'/'
)
first_error
=
first_error
.
gsub
(
/:([0-9]+):/
,
':'
+
Bacon
.
color
(
:yellow
,
'\1'
)
+
':'
)
puts
"
\n
#{
first_error
}
"
if
Backtraces
unless
Counter
[
:disabled
].
zero?
puts
Bacon
.
color
(
:yellow
,
"
#{
Counter
[
:disabled
]
}
disabled specifications"
)
...
...
@@ -117,6 +138,7 @@ module Bacon
puts
Bacon
.
color
(
:red
,
result
)
end
end
end
#---------------------------------------------------------------------------#
...
...
@@ -124,7 +146,7 @@ module Bacon
module
FilterBacktraces
def
handle_summary
ErrorLog
.
replace
(
ErrorLog
.
split
(
"
\n
"
).
reject
do
|
line
|
line
=~
%r{(gems/mocha|spec_helper)}
line
=~
%r{(gems/mocha|spec_helper
|ruby_noexec_wrapper
)}
end
.
join
(
"
\n
"
).
lstrip
<<
"
\n\n
"
)
super
end
...
...
@@ -141,6 +163,3 @@ module Bacon
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