Browse files

Make all specs green again.

  • Loading branch information...
1 parent 7b46404 commit 0bb0803253f7f3c672904688d0ef5b6622f5fe7d @alloy alloy committed Mar 4, 2012
Showing with 35 additions and 23 deletions.
  1. +1 −1 .travis.yml
  2. +0 −6 Rakefile
  3. +8 −6 lib/cocoapods/dependency.rb
  4. +1 −0 lib/cocoapods/downloader.rb
  5. +25 −10 spec/integration_spec.rb
View
2 .travis.yml
@@ -3,4 +3,4 @@ rvm:
- 1.8.7
- 1.9.3
before_install: git submodule update --init && cd external/Xcodeproj && rake travis:install_opencflite_debs && sudo apt-get install subversion
-script: cd ../.. && bundle exec rake spec:travis
+script: cd ../.. && bundle exec rake spec
View
6 Rakefile
@@ -81,12 +81,6 @@ namespace :spec do
Rake::Task['examples:build'].invoke
end
- # For now we don't run the intgration spec, but it should be cleaned up so it can run on Travis.
- desc "Run the travis CI specs"
- task :travis => "ext:cleanbuild" do
- sh "bacon #{FileList['spec/{functional,unit}/**/*_spec.rb'].join(' ')}"
- end
-
desc "Rebuild all the fixture tarballs"
task :rebuild_fixture_tarballs do
tarballs = FileList['spec/fixtures/**/*.tar.gz']
View
14 lib/cocoapods/dependency.rb
@@ -157,25 +157,27 @@ def copy_external_source_into_sandbox(sandbox)
end
def description
- "from '#{@params[:git]}'".tap do |description|
+ "from `#{@params[:git]}'".tap do |description|
description << ", commit `#{@params[:commit]}'" if @params[:commit]
description << ", tag `#{@params[:tag]}'" if @params[:tag]
end
end
end
-
+
+ # can be http, file, etc
class PodspecSource < AbstractExternalSource
def copy_external_source_into_sandbox(sandbox)
output_path = sandbox.root + "Local Podspecs/#{name}.podspec"
- podspec_url = @params[:podspec] # can be http, file, etc
- puts " * Fetching podspec for `#{name}' from: #{podspec_url}" unless Config.instance.silent?
- open(source) do |io|
+ output_path.dirname.mkpath
+ puts " * Fetching podspec for `#{name}' from: #{@params[:podspec]}" unless Config.instance.silent?
+ open(@params[:podspec]) do |io|
output_path.open('w') { |f| f << io.read }
end
end
def description
- version << "from '#{source[:podspec]}'"
+ # TODO did we have a version number here too before?
+ "from `#{@params[:podspec]}'"

Don't think we did.

@alloy
CocoaPods member
alloy added a note Mar 4, 2012

Ok, removing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
end
end
end
View
1 lib/cocoapods/downloader.rb
@@ -26,6 +26,7 @@ def clean
private
def self.for_target(target_path, options)
+ options = options.dup
if url = options.delete(:git)
Git.new(target_path, url, options)
elsif url = options.delete(:hg)
View
35 spec/integration_spec.rb
@@ -1,6 +1,8 @@
require File.expand_path('../spec_helper', __FILE__)
require 'yaml'
+# TODO Make specs faster by limiting remote network connections
+
module SpecHelper
class Installer < Pod::Installer
# Here we override the `source' of the pod specifications to point to the integration fixtures.
@@ -45,6 +47,15 @@ def set.specification
Pod::Config.instance = @config_before
end
+ # This is so we can run at least the specs that don't use xcodebuild on Travis.
+ def with_xcodebuild_available
+ unless `which xcodebuild`.strip.empty?
+ yield
+ else
+ puts "\n[!] Skipping xcodebuild, because it can't be found."
+ end
+ end
+
def should_successfully_perform(command)
output = `#{command} 2>&1`
puts output unless $?.success?
@@ -193,9 +204,11 @@ def should_successfully_perform(command)
project_file = (root + 'Pods.xcodeproj/project.pbxproj').to_s
Xcodeproj.read_plist(project_file).should == installer.project.to_hash
- puts "\n[!] Compiling static library..."
- Dir.chdir(config.project_pods_root) do
- should_successfully_perform "xcodebuild"
+ with_xcodebuild_available do
+ puts "\n[!] Compiling static library..."
+ Dir.chdir(config.project_pods_root) do
+ should_successfully_perform "xcodebuild"
+ end
end
end
@@ -297,13 +310,15 @@ def should_successfully_perform(command)
(root + 'Pods-debug-resources.sh').should.exist
(root + 'Pods-test-resources.sh').should.exist
- Dir.chdir(config.project_pods_root) do
- puts "\n[!] Compiling static library `Pods'..."
- should_successfully_perform "xcodebuild -target Pods"
- puts "\n[!] Compiling static library `Pods-debug'..."
- should_successfully_perform "xcodebuild -target Pods-debug"
- puts "\n[!] Compiling static library `Pods-test'..."
- should_successfully_perform "xcodebuild -target Pods-test"
+ with_xcodebuild_available do
+ Dir.chdir(config.project_pods_root) do
+ puts "\n[!] Compiling static library `Pods'..."
+ should_successfully_perform "xcodebuild -target Pods"
+ puts "\n[!] Compiling static library `Pods-debug'..."
+ should_successfully_perform "xcodebuild -target Pods-debug"
+ puts "\n[!] Compiling static library `Pods-test'..."
+ should_successfully_perform "xcodebuild -target Pods-test"
+ end
end
end

0 comments on commit 0bb0803

Please sign in to comment.