Commit da1fcacc authored by Eloy Duran's avatar Eloy Duran

Make the specs run with the addition of a new Reachability version.

parent b842655c
Subproject commit a0a6f17c205e76074384af2dbcc18796eff40ce0
Subproject commit 49cb88232dc6547bfc9751521a38889ec9f9f803
......@@ -78,8 +78,8 @@ describe "Pod::Command" do
it "searches for a pod with name, summary, or description matching the given query ignoring case" do
[
['systemCONfiguration', %w{ Reachablity }],
['is', %w{ ASIHTTPRequest Reachablity SSZipArchive }],
['systemCONfiguration', %w{ Reachability }],
['is', %w{ ASIHTTPRequest Reachability SSZipArchive }],
].each do |query, results|
command = Pod::Command.parse('search', '--silent', '--full', query)
def command.puts(msg = '')
......
......@@ -156,6 +156,7 @@ else
config.rootspec = self
self.platform platform
dependency 'Reachability', '< 2.0.5' if platform == :ios
dependency 'ASIWebPageRequest', '>= 1.8.1'
dependency 'JSONKit', '>= 1.0'
dependency 'SSZipArchive', '< 2'
......@@ -175,11 +176,13 @@ else
'DEPENDENCIES' => [
"ASIWebPageRequest (>= 1.8.1)",
"JSONKit (>= 1.0)",
"Reachability (< 2.0.5)",
"SSZipArchive (< 2)",
]
}
unless platform == :ios
# No Reachability is required by ASIHTTPRequest on OSX
lock_file_contents['DEPENDENCIES'].delete_at(2)
lock_file_contents['PODS'].delete_at(3)
lock_file_contents['PODS'][0] = 'ASIHTTPRequest (1.8.1)'
end
......@@ -196,23 +199,25 @@ else
end
end
it "does not activate pods that are only part of other pods" do
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
if platform == :ios
it "does not activate pods that are only part of other pods" do
spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform
dependency 'Reachability'
end
self.platform platform
dependency 'Reachability', '2.0.4' # only 2.0.4 is part of ASIHTTPRequest’s source.
end
installer = SpecHelper::Installer.new(spec)
installer.install!
installer = SpecHelper::Installer.new(spec)
installer.install!
YAML.load(installer.lock_file.read).should == {
'PODS' => [{ 'Reachability (2.0.4)' => ["ASIHTTPRequest (>= 1.8)"] }],
'DOWNLOAD_ONLY' => ["ASIHTTPRequest (1.8.1)"],
'DEPENDENCIES' => ["Reachability"]
}
YAML.load(installer.lock_file.read).should == {
'PODS' => [{ 'Reachability (2.0.4)' => ["ASIHTTPRequest (>= 1.8)"] }],
'DOWNLOAD_ONLY' => ["ASIHTTPRequest (1.8.1)"],
'DEPENDENCIES' => ["Reachability (= 2.0.4)"]
}
end
end
it "adds resources to the xcode copy script" do
......
......@@ -25,8 +25,6 @@ describe "Pod::Installer" do
config.silent = true
config.repos_dir = fixture('spec-repos')
config.project_pods_root = fixture('integration')
def config.ios?; true; end
def config.osx?; false; end
end
after do
......@@ -34,12 +32,13 @@ describe "Pod::Installer" do
end
it "generates a BridgeSupport metadata file from all the pod headers" do
spec = Pod::Podfile.new do
podfile = Pod::Podfile.new do
platform :osx
dependency 'ASIHTTPRequest'
end
config.rootspec = podfile
expected = []
installer = Pod::Installer.new(spec)
installer = Pod::Installer.new(podfile)
installer.build_specifications.each do |spec|
spec.header_files.each do |header|
expected << config.project_pods_root + header
......@@ -55,6 +54,7 @@ describe "Pod::Installer" do
dependency 'JSONKit'
end
end
config.rootspec = podfile
installer = Pod::Installer.new(podfile)
installer.target_installers.map(&:definition).map(&:name).should == [:not_empty]
end
......@@ -64,6 +64,7 @@ describe "Pod::Installer" do
platform :osx
dependency 'ASIHTTPRequest'
end
config.rootspec = podfile
installer = Pod::Installer.new(podfile)
installer.target_installers.first.install!
phases = installer.project.targets.first.buildPhases
......
......@@ -22,12 +22,16 @@ end
describe "Pod::Resolver" do
before do
Pod::Spec::Set.reset!
@config_before = config
Pod::Config.instance = nil
config.silent = true
config.repos_dir = fixture('spec-repos')
def config.ios?; true; end
def config.osx?; false; end
@podfile = Pod::Podfile.new do
platform :ios
dependency 'ASIWebPageRequest'
end
config.rootspec = @podfile
end
after do
......@@ -39,31 +43,29 @@ describe "Pod::Resolver" do
sets << Pod::Spec::Set.by_pod_dir(fixture('spec-repos/master/Reachability'))
sets << Pod::Spec::Set.by_pod_dir(fixture('spec-repos/master/ASIHTTPRequest'))
sets << Pod::Spec::Set.by_pod_dir(fixture('spec-repos/master/ASIWebPageRequest'))
resolver = Pod::Resolver.new(Pod::Spec.new { |s| s.dependency 'ASIWebPageRequest' })
resolver = Pod::Resolver.new(@podfile)
resolver.resolve.sort_by(&:name).should == sets.sort_by(&:name)
end
it "does not raise if all dependencies match the platform of the root spec (Podfile)" do
spec = Pod::Spec.new { |s| s.dependency 'ASIWebPageRequest' }
resolver = Pod::Resolver.new(spec)
resolver = Pod::Resolver.new(@podfile)
spec.platform = :ios
@podfile.platform :ios
lambda { resolver.resolve }.should.not.raise
spec.platform = :osx
@podfile.platform :osx
lambda { resolver.resolve }.should.not.raise
end
it "raises once any of the dependencies does not match the platform of the root spec (Podfile)" do
spec = Pod::Spec.new { |s| s.dependency 'ASIWebPageRequest' }
resolver = StubbedResolver.new(spec)
resolver = StubbedResolver.new(config.rootspec)
spec.platform = :ios
@podfile.platform :ios
resolver.stub_platform = :ios
lambda { resolver.resolve }.should.not.raise
resolver.stub_platform = :osx
lambda { resolver.resolve }.should.raise Pod::Informative
spec.platform = :osx
@podfile.platform :osx
resolver.stub_platform = :osx
lambda { resolver.resolve }.should.not.raise
resolver.stub_platform = :ios
......
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