Commit 5b5abd6c authored by Eloy Duran's avatar Eloy Duran

+ begin of integration spec

parent 064b1e08
[submodule "spec/fixtures/integration/ASIHTTPRequest"]
path = spec/fixtures/integration/ASIHTTPRequest
url = https://github.com/pokeb/asi-http-request.git
[submodule "spec/fixtures/integration/SSZipArchive"]
path = spec/fixtures/integration/SSZipArchive
url = https://github.com/samsoffes/ssziparchive.git
[submodule "spec/fixtures/integration/JSONKit"]
path = spec/fixtures/integration/JSONKit
url = https://github.com/johnezang/JSONKit.git
...@@ -10,7 +10,7 @@ module Pod ...@@ -10,7 +10,7 @@ module Pod
@instance = instance @instance = instance
end end
attr_accessor :repos_dir, :clean, :verbose, :silent attr_accessor :repos_dir, :project_pods_root, :clean, :verbose, :silent
alias_method :clean?, :clean alias_method :clean?, :clean
alias_method :verbose?, :verbose alias_method :verbose?, :verbose
alias_method :silent?, :silent alias_method :silent?, :silent
...@@ -27,7 +27,7 @@ module Pod ...@@ -27,7 +27,7 @@ module Pod
end end
def project_pods_root def project_pods_root
project_root + 'Pods' @project_pods_root ||= project_root + 'Pods'
end end
def project_podfile def project_podfile
......
...@@ -2,6 +2,8 @@ module Pod ...@@ -2,6 +2,8 @@ module Pod
# TODO the static library needs an extra xcconfig which sets the values from issue #1. # TODO the static library needs an extra xcconfig which sets the values from issue #1.
# Or we could edit the project.pbxproj file, but that seems like more work... # Or we could edit the project.pbxproj file, but that seems like more work...
class Installer class Installer
include Config::Mixin
def initialize(top_level_specification, pods_root) def initialize(top_level_specification, pods_root)
@top_level_specification, @pods_root = top_level_specification, pods_root @top_level_specification, @pods_root = top_level_specification, pods_root
end end
......
module Pod module Pod
class Source class Source
def self.all def self.all
@sources ||= Config.instance.repos_dir.children.map { |repo| new(repo) } @sources ||= Config.instance.repos_dir.children.select(&:directory?).map { |repo| new(repo) }
end end
def self.search(dependency) def self.search(dependency)
......
Subproject commit 90e5fbce17d66e5341f105c1eb26133a01686838
Subproject commit c2146ffeb10d92bfa1537d2033a3235825d1b261
Subproject commit 65a8282c0b5a6f84bc6266d73bbe7475ef75659d
require File.expand_path('../spec_helper', __FILE__)
module SpecHelper
class Installer < Pod::Installer
# Here we override the `source' of the pod specifications to point to the integration fixtures.
def dependent_specification_sets
@dependent_specification_sets ||= super
@dependent_specification_sets.each do |set|
def set.specification
spec = super
unless spec.part_of_other_pod?
source = spec.read(:source)
source[:git] = SpecHelper.fixture("integration/#{spec.read(:name)}").to_s
spec.source(source)
end
spec
end
end
@dependent_specification_sets
end
end
end
unless SpecHelper.fixture('integration/ASIHTTPRequest').exist?
puts "[!] You must init/update the git submodules for the integration spec to work, skipping."
else
describe "A full (integration spec) installation" do
extend SpecHelper::TemporaryDirectory
before do
Pod::Source.reset!
Pod::Spec::Set.reset!
fixture('spec-repos/master') # ensure the archive is unpacked
config.project_pods_root = SpecHelper.temporary_directory + 'Pods'
config.repos_dir = fixture('spec-repos')
end
after do
config.project_pods_root = nil
config.repos_dir = SpecHelper.tmp_repos_path
end
it "should work" do
spec = Pod::Spec.new do
dependency 'ASIWebPageRequest', '< 1.8.1'
dependency 'JSONKit', '>= 1.0'
dependency 'SSZipArchive', '< 2'
end
installer = SpecHelper::Installer.new(spec, SpecHelper.temporary_directory)
installer.install!
(config.project_pods_root + 'Reachability.podspec').should.exist
(config.project_pods_root + 'ASIHTTPRequest.podspec').should.exist
(config.project_pods_root + 'ASIWebPageRequest.podspec').should.exist
(config.project_pods_root + 'JSONKit.podspec').should.exist
(config.project_pods_root + 'SSZipArchive.podspec').should.exist
end
it "does not activate pods that are only part of other pods" do
spec = Pod::Spec.new do
dependency 'Reachability'
end
installer = SpecHelper::Installer.new(spec, SpecHelper.temporary_directory)
installer.install!
(config.project_pods_root + 'Reachability.podspec').should.exist
(config.project_pods_root + 'ASIHTTPRequest.podspec').should.not.exist
end
end
end
...@@ -16,7 +16,7 @@ module SpecHelper ...@@ -16,7 +16,7 @@ module SpecHelper
end end
def teardown_temporary_directory def teardown_temporary_directory
temporary_directory.rmtree temporary_directory.rmtree if temporary_directory.exist?
end end
def self.extended(base) def self.extended(base)
......
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