Commit 385d9b38 authored by Eloy Duran's avatar Eloy Duran

Don’t break when there’s no rootspec. Closes #30.

parent 78c554e3
...@@ -55,11 +55,11 @@ module Pod ...@@ -55,11 +55,11 @@ module Pod
end end
def ios? def ios?
rootspec.platform == :ios rootspec.platform == :ios if rootspec
end end
def osx? def osx?
rootspec.platform == :osx rootspec.platform == :osx if rootspec
end end
module Mixin module Mixin
......
...@@ -32,14 +32,20 @@ else ...@@ -32,14 +32,20 @@ else
Pod::Source.reset! Pod::Source.reset!
Pod::Spec::Set.reset! Pod::Spec::Set.reset!
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
@config_before = config
Pod::Config.instance = nil
config.silent = true
config.repos_dir = fixture('spec-repos') config.repos_dir = fixture('spec-repos')
config.project_pods_root = temporary_directory + 'Pods' config.project_pods_root = temporary_directory + 'Pods'
def config.ios?; true; end
def config.osx?; false; end
FileUtils.cp_r(fixture('integration/.'), config.project_pods_root) FileUtils.cp_r(fixture('integration/.'), config.project_pods_root)
end end
after do after do
config.project_pods_root = nil Pod::Config.instance = @config_before
config.repos_dir = SpecHelper.tmp_repos_path
end end
# TODO add a simple source file which uses the compiled lib to check that it really really works # TODO add a simple source file which uses the compiled lib to check that it really really works
......
...@@ -17,14 +17,19 @@ describe "Pod::Installer" do ...@@ -17,14 +17,19 @@ describe "Pod::Installer" do
end end
before do before do
config.project_pods_root = fixture('integration')
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
@config_before = config
Pod::Config.instance = nil
config.silent = true
config.repos_dir = fixture('spec-repos') config.repos_dir = fixture('spec-repos')
config.project_pods_root = fixture('integration')
def config.ios?; true; end
def config.osx?; false; end
end end
after do after do
config.project_pods_root = nil Pod::Config.instance = @config_before
config.repos_dir = SpecHelper.tmp_repos_path
end end
it "generates a BridgeSupport metadata file from all the pod headers" do it "generates a BridgeSupport metadata file from all the pod headers" do
...@@ -54,8 +59,8 @@ describe "Pod::Installer" do ...@@ -54,8 +59,8 @@ describe "Pod::Installer" do
'"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"', '"$(BUILT_PRODUCTS_DIR)/Pods/Reachability"',
"ALWAYS_SEARCH_USER_PATHS" => "YES", "ALWAYS_SEARCH_USER_PATHS" => "YES",
"OTHER_LDFLAGS" => "-ObjC -all_load " \ "OTHER_LDFLAGS" => "-ObjC -all_load " \
"-framework SystemConfiguration -framework CFNetwork " \ "-framework SystemConfiguration -framework MobileCoreServices " \
"-framework MobileCoreServices -l z.1" "-framework CFNetwork -lz.1"
} }
], ],
[ [
...@@ -81,7 +86,7 @@ describe "Pod::Installer" do ...@@ -81,7 +86,7 @@ describe "Pod::Installer" do
"HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2", "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2",
"OTHER_LDFLAGS" => "-ObjC -all_load " \ "OTHER_LDFLAGS" => "-ObjC -all_load " \
"-l xml2.2.7.3 -framework SystemConfiguration " \ "-l xml2.2.7.3 -framework SystemConfiguration " \
"-framework CFNetwork -framework MobileCoreServices -l z.1" "-framework MobileCoreServices -framework CFNetwork -lz.1"
} }
], ],
].each do |name, patterns, expected_patterns, xcconfig| ].each do |name, patterns, expected_patterns, xcconfig|
......
...@@ -23,11 +23,16 @@ end ...@@ -23,11 +23,16 @@ end
describe "Pod::Resolver" do describe "Pod::Resolver" do
before do before do
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
@config_before = config
Pod::Config.instance = nil
config.silent = true
config.repos_dir = fixture('spec-repos') config.repos_dir = fixture('spec-repos')
def config.ios?; true; end
def config.osx?; false; end
end end
after do after do
config.repos_dir = SpecHelper.tmp_repos_path Pod::Config.instance = @config_before
end end
it "returns all sets needed for the dependency" do it "returns all sets needed for the dependency" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment