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
d59409f6
Commit
d59409f6
authored
May 16, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Specs] Cleaning up temporary repos helper.
parent
139d0099
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
27 deletions
+32
-27
list_spec.rb
spec/functional/command/list_spec.rb
+1
-1
push_spec.rb
spec/functional/command/push_spec.rb
+9
-5
repo_spec.rb
spec/functional/command/repo_spec.rb
+1
-1
search_spec.rb
spec/functional/command/search_spec.rb
+1
-1
setup_spec.rb
spec/functional/command/setup_spec.rb
+1
-1
spec_spec.rb
spec/functional/command/spec_spec.rb
+2
-2
command_spec.rb
spec/functional/command_spec.rb
+1
-1
spec_helper.rb
spec/spec_helper.rb
+1
-1
temporary_repos.rb
spec/spec_helper/temporary_repos.rb
+12
-9
resolver_spec.rb
spec/unit/resolver_spec.rb
+2
-4
source_spec.rb
spec/unit/source_spec.rb
+1
-1
No files found.
spec/functional/command/list_spec.rb
View file @
d59409f6
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::List"
do
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryRepos
before
do
config
.
repos_dir
=
fixture
(
'spec-repos'
)
...
...
spec/functional/command/push_spec.rb
View file @
d59409f6
...
...
@@ -2,8 +2,12 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe
Pod
::
Command
::
Push
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
def
master_repo
fixture
(
'spec-repos/master'
)
end
it
"complains for wrong parameters"
do
lambda
{
run_command
(
'push'
)
}.
should
.
raise
Pod
::
Command
::
Help
...
...
@@ -12,19 +16,19 @@ describe Pod::Command::Push do
end
it
"complains if it can't find the repo"
do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
)
)
repo1
=
add_repo
(
'repo1'
,
master_repo
)
Dir
.
chdir
(
fixture
(
'banana-lib'
))
do
lambda
{
run_command
(
'push'
,
'repo2'
)
}.
should
.
raise
Pod
::
Informative
end
end
it
"complains if it can't find a spec"
do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
)
)
repo1
=
add_repo
(
'repo1'
,
master_repo
)
lambda
{
run_command
(
'push'
,
'repo1'
)
}.
should
.
raise
Pod
::
Informative
end
it
"it raises if the pod is not validated"
do
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
)
)
repo1
=
add_repo
(
'repo1'
,
master_repo
)
git
(
'repo1'
,
'checkout master'
)
# checkout master, because the fixture is a submodule
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
git_config
(
'repo2'
,
'remote.origin.url'
).
should
==
(
tmp_repos_path
+
'repo1'
).
to_s
...
...
@@ -36,7 +40,7 @@ describe Pod::Command::Push do
before
do
# prepare the repos
@upstream
=
add_repo
(
'upstream'
,
fixture
(
'spec-repos/master'
)
)
@upstream
=
add_repo
(
'upstream'
,
master_repo
)
git
(
'upstream'
,
'checkout -b master'
)
# checkout master, because the fixture is a submodule
@local_repo
=
add_repo
(
'local_repo'
,
@upstream
.
dir
)
git_config
(
'local_repo'
,
'remote.origin.url'
).
should
==
(
tmp_repos_path
+
'upstream'
).
to_s
...
...
spec/functional/command/repo_spec.rb
View file @
d59409f6
...
...
@@ -2,8 +2,8 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe
"Pod::Command::Repo"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"runs with correct parameters"
do
lambda
{
run_command
(
'repo'
,
'add'
,
'NAME'
,
'URL'
)
}.
should
.
not
.
raise
...
...
spec/functional/command/search_spec.rb
View file @
d59409f6
...
...
@@ -2,8 +2,8 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe
"Pod::Command::Search"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
before
do
config
.
repos_dir
=
fixture
(
'spec-repos'
)
...
...
spec/functional/command/setup_spec.rb
View file @
d59409f6
...
...
@@ -3,8 +3,8 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe
"Pod::Command::Setup"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
it
"runs with correct parameters"
do
lambda
{
run_command
(
'setup'
)
}.
should
.
not
.
raise
...
...
spec/functional/command/spec_spec.rb
View file @
d59409f6
...
...
@@ -18,7 +18,7 @@ describe "Pod::Command::Spec#create" do
extend
SpecHelper
::
Command
extend
SpecHelper
::
Github
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryRepos
it
"creates a new podspec stub file"
do
run_command
(
'spec'
,
'create'
,
'Bananas'
)
...
...
@@ -94,7 +94,7 @@ end
describe
"Pod::Command::Spec#lint"
do
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryRepos
before
do
config
.
repos_dir
=
fixture
(
'spec-repos'
)
...
...
spec/functional/command_spec.rb
View file @
d59409f6
...
...
@@ -2,8 +2,8 @@ require File.expand_path('../../spec_helper', __FILE__)
# describe "Pod::Command" do
# extend SpecHelper::Command
# extend SpecHelper::Git
# extend SpecHelper::TemporaryDirectory
# extend SpecHelper::TemporaryRepos
#
# TODO:
# it "raises help informative if an unknown parameter is passed"
...
...
spec/spec_helper.rb
View file @
d59409f6
...
...
@@ -15,9 +15,9 @@ $:.unshift((ROOT + 'spec').to_s)
require
'spec_helper/color_output'
require
'spec_helper/command'
require
'spec_helper/fixture'
require
'spec_helper/git'
require
'spec_helper/github'
require
'spec_helper/temporary_directory'
require
'spec_helper/temporary_repos'
module
Bacon
extend
ColorOutput
...
...
spec/spec_helper/
git
.rb
→
spec/spec_helper/
temporary_repos
.rb
View file @
d59409f6
...
...
@@ -2,22 +2,18 @@ require 'spec_helper/temporary_directory'
module
SpecHelper
def
self
.
tmp_repos_path
Git
.
tmp_repos_path
TemporaryRepos
.
tmp_repos_path
end
module
Git
module
TemporaryRepos
extend
Pod
::
Executable
executable
:git
def
tmp_repos_path
SpecHelper
.
temporary_directory
+
'cocoapods'
end
module_function
:tmp_repos_path
def
tmp_master_repo_path
tmp_repos_path
+
'master'
end
extend
Pod
::
Executable
executable
:git
alias_method
:git_super
,
:git
def
git
(
repo
,
command
)
Dir
.
chdir
(
tmp_repos_path
+
repo
)
do
...
...
@@ -42,5 +38,12 @@ module SpecHelper
git
(
name
,
'add README'
)
git
(
name
,
'commit -m "changed"'
)
end
def
self
.
extended
(
base
)
base
.
before
do
tmp_repos_path
.
mkpath
end
end
end
end
spec/unit/resolver_spec.rb
View file @
d59409f6
...
...
@@ -2,10 +2,8 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Resolver"
do
before
do
@config_before
=
config
Pod
::
Config
.
instance
=
nil
config
.
silent
=
true
config
.
repos_dir
=
fixture
(
'spec-repos'
)
@podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
dependency
'BlocksKit'
...
...
@@ -15,7 +13,7 @@ describe "Pod::Resolver" do
end
after
do
Pod
::
Config
.
instance
=
@config_before
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
end
xit
"holds the context state, such as cached specification sets"
do
...
...
spec/unit/source_spec.rb
View file @
d59409f6
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Source"
do
extend
SpecHelper
::
Git
extend
SpecHelper
::
Command
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryRepos
before
do
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
...
...
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