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
b40574f2
Commit
b40574f2
authored
Feb 14, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Integration] Isolate from spec helper and clean up Rakefile
parent
7c24e3ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
6 deletions
+86
-6
Rakefile
Rakefile
+86
-6
integration_2.rb
spec/integration_2.rb
+0
-0
No files found.
Rakefile
View file @
b40574f2
...
...
@@ -7,7 +7,10 @@ def execute_command(command)
end
end
#-----------------------------------------------------------------------------#
namespace
:gem
do
def
gem_version
require
File
.
expand_path
(
'../lib/cocoapods'
,
__FILE__
)
Pod
::
VERSION
...
...
@@ -17,16 +20,22 @@ namespace :gem do
"cocoapods-
#{
gem_version
}
.gem"
end
#--------------------------------------#
desc
"Build a gem for the current version"
task
:build
do
sh
"gem build cocoapods.gemspec"
end
#--------------------------------------#
desc
"Install a gem version of the current code"
task
:install
=>
:build
do
sh
"gem install
#{
gem_filename
}
"
end
#--------------------------------------#
def
silent_sh
(
command
)
output
=
`
#{
command
}
2>&1`
unless
$?
.
success?
...
...
@@ -139,41 +148,91 @@ namespace :gem do
end
end
#-----------------------------------------------------------------------------#
namespace
:spec
do
def
specs
(
dir
)
FileList
[
"spec/
#{
dir
}
/*_spec.rb"
].
shuffle
.
join
(
' '
)
end
def
title
(
title
)
cyan_title
=
"
\033
[0;36m
#{
title
}
\033
[0m"
puts
puts
"-"
*
80
puts
"|
#{
cyan_title
.
ljust
(
87
)
}
|"
puts
"-"
*
80
puts
end
#--------------------------------------#
desc
"Automatically run specs for updated files"
task
:kick
do
exec
"bundle exec kicker -c"
end
#--------------------------------------#
desc
"Run the unit specs"
task
:unit
=>
:unpack_fixture_tarballs
do
sh
"bundle exec bacon
#{
specs
(
'unit/**'
)
}
-q"
end
#--------------------------------------#
desc
"Run the functional specs"
task
:functional
=>
:unpack_fixture_tarballs
do
sh
"bundle exec bacon
#{
specs
(
'functional/**'
)
}
"
end
#--------------------------------------#
desc
"Run the integration spec"
task
:integration
=>
:unpack_fixture_tarballs
do
sh
"bundle exec bacon spec/integration_spec.rb"
sh
"bundle exec bacon spec/integration_2.rb"
end
# Default task
#--------------------------------------#
#
# The specs helper interfere with the integration 2 specs and thus they need
# to be run separately.
#
task
:all
=>
:unpack_fixture_tarballs
do
sh
"bundle exec bacon
#{
specs
(
'**'
)
}
"
title
'Running the specs'
sh
"bundle exec bacon
#{
specs
(
'**'
)
}
"
title
'Running Integration 2 tests'
sh
"bundle exec bacon spec/integration_2.rb"
title
'Running examples'
Rake
::
Task
[
'examples:build'
].
invoke
end
# Travis
#--------------------------------------#
#
# The integration 2 tests and the examples use the normal CocoaPods setup.
#
desc
"Run all specs and build all examples"
task
:ci
=>
:all
do
sh
"./bin/pod setup"
# ensure the spec repo is up-to-date
task
:ci
=>
:unpack_fixture_tarballs
do
title
'Running the specs'
sh
"bundle exec bacon
#{
specs
(
'**'
)
}
"
title
'Ensuring specs repo is up to date'
sh
"./bin/pod setup"
title
'Running Integration 2 tests'
sh
"bundle exec bacon spec/integration_2.rb"
title
'Running examples'
Rake
::
Task
[
'examples:build'
].
invoke
end
#--------------------------------------#
desc
"Rebuild all the fixture tarballs"
task
:rebuild_fixture_tarballs
do
tarballs
=
FileList
[
'spec/fixtures/**/*.tar.gz'
]
...
...
@@ -183,6 +242,8 @@ namespace :spec do
end
end
#--------------------------------------#
desc
"Unpacks all the fixture tarballs"
task
:unpack_fixture_tarballs
do
tarballs
=
FileList
[
'spec/fixtures/**/*.tar.gz'
]
...
...
@@ -194,11 +255,15 @@ namespace :spec do
end
end
#--------------------------------------#
desc
"Removes the stored VCR fixture"
task
:clean_vcr
do
sh
"rm -f spec/fixtures/vcr/tarballs.yml"
end
#--------------------------------------#
desc
"Rebuild integration take 2 after folders"
task
:rebuild_integration_after_folders
do
# TODO Run the tests manually before calling this for now
...
...
@@ -218,13 +283,17 @@ namespace :spec do
FileList
[
'spec/integration/*/after/{Podfile,**/*.xcodeproj}'
].
each
do
|
to_delete
|
sh
"rm -rf
#{
to_delete
}
"
end
end
#--------------------------------------#
task
:clean_env
=>
[
:clean_vcr
,
:unpack_fixture_tarballs
,
"ext:cleanbuild"
]
end
#-----------------------------------------------------------------------------#
namespace
:examples
do
def
examples
require
'pathname'
result
=
[]
...
...
@@ -239,7 +308,9 @@ namespace :examples do
result
end
desc
"Open all example workspaced in Xcode, which recreates the schemes."
#--------------------------------------#
desc
"Open all example workspaces in Xcode, which recreates the schemes."
task
:recreate_workspace_schemes
do
examples
.
each
do
|
example
|
Dir
.
chdir
(
example
.
to_s
)
do
...
...
@@ -251,6 +322,8 @@ namespace :examples do
end
end
#--------------------------------------#
desc
"Build all examples"
task
:build
do
execute_command
"rm -rf ~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.*"
...
...
@@ -269,8 +342,13 @@ namespace :examples do
end
end
end
#--------------------------------------#
end
#-----------------------------------------------------------------------------#
desc
"Initializes your working copy to run the specs"
task
:bootstrap
do
puts
"Updating submodules"
...
...
@@ -280,10 +358,12 @@ task :bootstrap do
execute_command
"bundle install"
puts
"Installing tools (Homebrew)"
execute_command
"brew install appledoc"
if
`which appledoc`
.
strip
.
empty?
execute_command
"brew install appledoc"
if
`which appledoc`
.
strip
.
empty?
execute_command
"brew install mercurial"
if
`which hg`
.
strip
.
empty?
end
#-----------------------------------------------------------------------------#
desc
"Run all specs"
task
:spec
=>
'spec:all'
...
...
spec/integration_2
_spec
.rb
→
spec/integration_2.rb
View file @
b40574f2
File moved
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