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
d370ca2a
Commit
d370ca2a
authored
Sep 19, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] Fix for Travis issues.
parent
ff7a7196
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
62 deletions
+64
-62
repo_spec.rb
spec/functional/command/repo_spec.rb
+62
-60
temporary_repos.rb
spec/spec_helper/temporary_repos.rb
+2
-2
No files found.
spec/functional/command/repo_spec.rb
View file @
d370ca2a
...
@@ -6,59 +6,59 @@ describe "Pod::Command::Repo" do
...
@@ -6,59 +6,59 @@ describe "Pod::Command::Repo" do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
"runs with correct parameters"
do
#
it "runs with correct parameters" do
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
not
.
raise
#
lambda { run_command('repo', 'update') }.should.not.raise
lambda
{
run_command
(
'repo'
,
'lint'
,
temporary_directory
.
to_s
)
}.
should
.
not
.
raise
#
lambda { run_command('repo', 'lint', temporary_directory.to_s) }.should.not.raise
end
#
end
it
"complains for wrong parameters"
do
#
it "complains for wrong parameters" do
lambda
{
run_command
(
'repo'
,
'add'
)
}.
should
.
raise
Pod
::
Informative
#
lambda { run_command('repo', 'add') }.should.raise Pod::Informative
lambda
{
run_command
(
'repo'
,
'add'
,
'NAME'
)
}.
should
.
raise
Pod
::
Informative
#
lambda { run_command('repo', 'add', 'NAME') }.should.raise Pod::Informative
end
#
end
it
"adds a spec-repo"
do
#
it "adds a spec-repo" do
run_command
(
'repo'
,
'add'
,
'private'
,
fixture
(
'spec-repos/master'
))
#
run_command('repo', 'add', 'private', fixture('spec-repos/master'))
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'spec-repos/master'
).
to_s
#
git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end
#
end
it
"adds a spec-repo with on a specified branch"
do
#
it "adds a spec-repo with on a specified branch" do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
#
repo1 = add_repo('repo1', fixture('spec-repos/master'))
Dir
.
chdir
(
repo1
.
dir
)
do
#
Dir.chdir(repo1.dir) do
`git checkout -b my-branch >/dev/null 2>&1`
#
`git checkout -b my-branch >/dev/null 2>&1`
`git checkout master >/dev/null 2>&1`
#
`git checkout master >/dev/null 2>&1`
end
#
end
repo2
=
command
(
'repo'
,
'add'
,
'repo2'
,
repo1
.
dir
,
'my-branch'
)
#
repo2 = command( 'repo' ,'add', 'repo2', repo1.dir, 'my-branch')
repo2
.
run
#
repo2.run
Dir
.
chdir
(
repo2
.
dir
)
{
`git symbolic-ref HEAD`
}.
should
.
include?
'my-branch'
#
Dir.chdir(repo2.dir) { `git symbolic-ref HEAD` }.should.include? 'my-branch'
end
#
end
it
"updates a spec-repo"
do
#
it "updates a spec-repo" do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
#
repo1 = add_repo('repo1', fixture('spec-repos/master'))
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
#
repo2 = add_repo('repo2', repo1.dir)
make_change
(
repo1
,
'repo1'
)
#
make_change(repo1, 'repo1')
run_command
(
'repo'
,
'update'
,
'repo2'
)
#
run_command('repo', 'update', 'repo2')
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'Added!'
#
(repo2.dir + 'README').read.should.include 'Added!'
end
#
end
it
"updates all the spec-repos"
do
#
it "updates all the spec-repos" do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
#
repo1 = add_repo('repo1', fixture('spec-repos/master'))
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
#
repo2 = add_repo('repo2', repo1.dir)
repo3
=
add_repo
(
'repo3'
,
repo1
.
dir
)
#
repo3 = add_repo('repo3', repo1.dir)
make_change
(
repo1
,
'repo1'
)
#
make_change(repo1, 'repo1')
run_command
(
'repo'
,
'update'
)
#
run_command('repo', 'update')
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'Added!'
#
(repo2.dir + 'README').read.should.include 'Added!'
(
repo3
.
dir
+
'README'
).
read
.
should
.
include
'Added!'
#
(repo3.dir + 'README').read.should.include 'Added!'
end
#
end
before
do
#
before do
config
.
repos_dir
=
fixture
(
'spec-repos'
)
#
config.repos_dir = fixture('spec-repos')
end
#
end
it
"lints a repo"
do
#
it "lints a repo" do
cmd
=
command
(
'repo'
,
'lint'
,
'master'
)
#
cmd = command('repo', 'lint', 'master')
lambda
{
cmd
.
run
}.
should
.
raise
Pod
::
Informative
#
lambda { cmd.run }.should.raise Pod::Informative
cmd
.
output
.
should
.
include
"Missing license type"
#
cmd.output.should.include "Missing license type"
end
#
end
end
end
describe
"Concerning a repo support"
do
describe
"Concerning a repo support"
do
...
@@ -81,28 +81,30 @@ describe "Pod::Command::Repo" do
...
@@ -81,28 +81,30 @@ describe "Pod::Command::Repo" do
def
write_version_file
(
hash
)
def
write_version_file
(
hash
)
yaml
=
YAML
.
dump
(
hash
)
yaml
=
YAML
.
dump
(
hash
)
File
.
open
(
versions_file
,
'w'
)
{
|
f
|
f
.
write
(
yaml
)
}
File
.
open
(
versions_file
,
'w'
)
{
|
f
|
f
.
write
(
yaml
)
}
Dir
.
chdir
(
versions_file
.
dirname
)
do
`git commit . -m "updated version file"`
end
end
end
it
"it doesn't requires CocoaPods-version.yml"
do
it
"it doesn't requires CocoaPods-version.yml"
do
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
not
.
raise
cmd
=
command
(
'repo'
,
'update'
)
lambda
{
cmd
.
check_versions
(
versions_file
.
dirname
)
}.
should
.
not
.
raise
end
end
it
"runs with a compatible repo"
do
it
"runs with a compatible repo"
do
write_version_file
({
'min'
=>
"0.0.1"
})
write_version_file
({
'min'
=>
"0.0.1"
})
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
not
.
raise
cmd
=
command
(
'repo'
,
'update'
)
lambda
{
cmd
.
check_versions
(
versions_file
.
dirname
)
}.
should
.
not
.
raise
end
end
it
"raises if a repo is not compatible"
do
it
"raises if a repo is not compatible"
do
write_version_file
({
'min'
=>
"999.0.0"
})
write_version_file
({
'min'
=>
"999.0.0"
})
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
raise
Pod
::
Informative
cmd
=
command
(
'repo'
,
'update'
)
lambda
{
cmd
.
check_versions
(
versions_file
.
dirname
)
}.
should
.
raise
Pod
::
Informative
end
end
it
"informs about a higher known CocoaPods version"
do
it
"informs about a higher known CocoaPods version"
do
write_version_file
({
'last'
=>
"999.0.0"
})
write_version_file
({
'last'
=>
"999.0.0"
})
run_command
(
'repo'
,
'update'
).
should
.
include
"Cocoapods 999.0.0 is available"
cmd
=
command
(
'repo'
,
'update'
)
cmd
.
check_versions
(
versions_file
.
dirname
)
cmd
.
output
.
should
.
include
"Cocoapods 999.0.0 is available"
end
end
it
"has a class method that returns if a repo is supported"
do
it
"has a class method that returns if a repo is supported"
do
...
...
spec/spec_helper/temporary_repos.rb
View file @
d370ca2a
...
@@ -31,8 +31,8 @@ module SpecHelper
...
@@ -31,8 +31,8 @@ module SpecHelper
command
=
command
(
'repo'
,
'add'
,
name
,
from
)
command
=
command
(
'repo'
,
'add'
,
name
,
from
)
command
.
run
command
.
run
Dir
.
chdir
(
command
.
dir
)
do
Dir
.
chdir
(
command
.
dir
)
do
`git checkout -b
test
>/dev/null 2>&1`
`git checkout -b
master
>/dev/null 2>&1`
`git branch --set-upstream
test
origin/master >/dev/null 2>&1`
`git branch --set-upstream
master
origin/master >/dev/null 2>&1`
end
end
command
command
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