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
2426f95c
Commit
2426f95c
authored
May 16, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] Improved output.
parent
fe461952
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
66 deletions
+72
-66
spec_helper.rb
spec/spec_helper.rb
+2
-23
bacon.rb
spec/spec_helper/bacon.rb
+70
-0
color_output.rb
spec/spec_helper/color_output.rb
+0
-43
No files found.
spec/spec_helper.rb
View file @
2426f95c
...
@@ -12,7 +12,7 @@ $:.unshift((ROOT + 'lib').to_s)
...
@@ -12,7 +12,7 @@ $:.unshift((ROOT + 'lib').to_s)
require
'cocoapods'
require
'cocoapods'
$:
.
unshift
((
ROOT
+
'spec'
).
to_s
)
$:
.
unshift
((
ROOT
+
'spec'
).
to_s
)
require
'spec_helper/
color_output
'
require
'spec_helper/
bacon
'
require
'spec_helper/command'
require
'spec_helper/command'
require
'spec_helper/fixture'
require
'spec_helper/fixture'
require
'spec_helper/github'
require
'spec_helper/github'
...
@@ -20,39 +20,20 @@ require 'spec_helper/temporary_directory'
...
@@ -20,39 +20,20 @@ require 'spec_helper/temporary_directory'
require
'spec_helper/temporary_repos'
require
'spec_helper/temporary_repos'
module
Bacon
module
Bacon
extend
ColorOutput
summary_at_exit
module
FilterBacktraces
def
handle_summary
ErrorLog
.
replace
(
ErrorLog
.
split
(
"
\n
"
).
reject
do
|
line
|
line
=~
%r{(gems/mocha|spec_helper)}
end
.
join
(
"
\n
"
).
lstrip
<<
"
\n\n
"
)
super
end
end
extend
FilterBacktraces
class
Context
class
Context
include
Pod
::
Config
::
Mixin
include
Pod
::
Config
::
Mixin
include
SpecHelper
::
Fixture
include
SpecHelper
::
Fixture
def
argv
(
*
argv
)
def
argv
(
*
argv
)
Pod
::
Command
::
ARGV
.
new
(
argv
)
Pod
::
Command
::
ARGV
.
new
(
argv
)
end
end
require
'colored'
def
xit
(
description
,
*
args
)
puts
"-
#{
description
}
[DISABLED]"
.
yellow
ErrorLog
<<
"[DISABLED]
#{
self
.
name
}
#{
description
}
\n\n
"
end
end
end
end
end
config
=
Pod
::
Config
.
instance
config
=
Pod
::
Config
.
instance
config
.
silent
=
true
config
.
silent
=
true
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
Pod
::
Specification
::
Statistics
.
instance
.
cache_file
=
nil
require
'tmpdir'
require
'tmpdir'
...
@@ -85,5 +66,3 @@ VCR.configure do |c|
...
@@ -85,5 +66,3 @@ VCR.configure do |c|
c
.
allow_http_connections_when_no_cassette
=
true
c
.
allow_http_connections_when_no_cassette
=
true
end
end
Pod
::
Specification
::
Statistics
.
instance
.
cache_file
=
nil
spec/spec_helper/bacon.rb
0 → 100644
View file @
2426f95c
module
Bacon
summary_at_exit
@needs_first_put
=
true
module
ColorOutput
# Graciously yanked from https://github.com/zen-cms/Zen-Core and subsequently modified
# MIT License
# Thanks, YorickPeterse! #:nodoc:
def
handle_specification
(
name
)
if
@needs_first_put
@needs_first_put
=
false
puts
end
@specs_depth
=
@specs_depth
||
0
puts
spaces
+
name
@specs_depth
+=
1
yield
@specs_depth
-=
1
puts
if
@specs_depth
.
zero?
end
#:nodoc:
def
handle_requirement
(
description
,
disabled
=
false
)
error
=
yield
if
!
error
.
empty?
puts
"
#{
spaces
}
\e
[31m-
#{
description
}
[FAILED]
\e
[0m"
elsif
disabled
puts
"
#{
spaces
}
\e
[33m-
#{
description
}
[DISABLED]
\e
[0m"
else
puts
"
#{
spaces
}
\e
[32m-
#{
description
}
\e
[0m"
end
end
#:nodoc:
def
handle_summary
print
ErrorLog
if
Backtraces
puts
"%d specifications (%d requirements), %d failures, %d errors"
%
Counter
.
values_at
(
:specifications
,
:requirements
,
:failed
,
:errors
)
end
#:nodoc:
def
spaces
return
' '
*
@specs_depth
end
end
extend
ColorOutput
module
FilterBacktraces
def
handle_summary
ErrorLog
.
replace
(
ErrorLog
.
split
(
"
\n
"
).
reject
do
|
line
|
line
=~
%r{(gems/mocha|spec_helper)}
end
.
join
(
"
\n
"
).
lstrip
<<
"
\n\n
"
)
super
end
end
extend
FilterBacktraces
class
Context
def
xit
(
description
,
*
args
)
Bacon
.
handle_requirement
(
description
,
true
)
{[]}
title
=
"
\e
[33m-> Disabled Specificiations
\e
[0m"
ErrorLog
.
insert
(
0
,
"
#{
title
}
\n
"
)
unless
ErrorLog
.
include?
(
title
)
ErrorLog
.
insert
(
title
.
length
,
"
\n
-
#{
self
.
name
}
#{
description
}
"
)
end
end
end
spec/spec_helper/color_output.rb
deleted
100644 → 0
View file @
fe461952
# Graciously yanked from https://github.com/zen-cms/Zen-Core
# MIT License
# Thanks, YorickPeterse!
#:nodoc:
module
Bacon
#:nodoc:
module
ColorOutput
#:nodoc:
def
handle_specification
(
name
)
puts
spaces
+
name
yield
puts
if
Counter
[
:context_depth
]
==
1
end
#:nodoc:
def
handle_requirement
(
description
)
error
=
yield
if
!
error
.
empty?
puts
"
#{
spaces
}
\e
[31m-
#{
description
}
[FAILED]
\e
[0m"
else
puts
"
#{
spaces
}
\e
[32m-
#{
description
}
\e
[0m"
end
end
#:nodoc:
def
handle_summary
print
ErrorLog
if
Backtraces
puts
"%d specifications (%d requirements), %d failures, %d errors"
%
Counter
.
values_at
(
:specifications
,
:requirements
,
:failed
,
:errors
)
end
#:nodoc:
def
spaces
if
Counter
[
:context_depth
]
==
0
Counter
[
:context_depth
]
=
1
end
return
' '
*
(
Counter
[
:context_depth
]
-
1
)
end
end
# ColorOutput
end
# Bacon
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