Skip to content

Commit

Permalink
Make all specs green again.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Mar 4, 2012
1 parent 7b46404 commit 0bb0803
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
14 changes: 8 additions & 6 deletions lib/cocoapods/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]}'"

This comment has been minimized.

Copy link
@lukeredpath

lukeredpath Mar 4, 2012

Contributor

Don't think we did.

This comment has been minimized.

Copy link
@alloy

alloy Mar 4, 2012

Author Member

Ok, removing it.

end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/cocoapods/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
35 changes: 25 additions & 10 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0bb0803

Please sign in to comment.