Commit c821caaf authored by Eloy Duran's avatar Eloy Duran

Make the specs run on MRI 1.9.3

parent 0f8df375
...@@ -85,21 +85,21 @@ end ...@@ -85,21 +85,21 @@ end
namespace :spec do namespace :spec do
desc "Run the unit specs" desc "Run the unit specs"
task :unit do task :unit do
sh "macbacon spec/unit/**/*_spec.rb" sh "bacon spec/unit/**/*_spec.rb"
end end
desc "Run the functional specs" desc "Run the functional specs"
task :functional do task :functional do
sh "macbacon spec/functional/*_spec.rb" sh "bacon spec/functional/*_spec.rb"
end end
desc "Run the integration spec" desc "Run the integration spec"
task :integration do task :integration do
sh "macbacon spec/integration_spec.rb" sh "bacon spec/integration_spec.rb"
end end
task :all do task :all do
sh "macbacon -a" sh "bacon spec/**/*_spec.rb"
end end
desc "Run all specs and build all examples" desc "Run all specs and build all examples"
......
Subproject commit ca3fe8f63cdaddbdf6a465e6352c7ca6501ee164 Subproject commit 23a54f4021bcfebf284e3cb62decc7c832594285
require 'rake' if RUBY_VERSION >= "1.9"
require 'rake/file_list'
else
require 'rake'
end
# This makes Rake::FileList usable with the Specification attributes # This makes Rake::FileList usable with the Specification attributes
# source_files, clean_paths, and resources. # source_files, clean_paths, and resources.
...@@ -19,6 +23,10 @@ module Rake ...@@ -19,6 +23,10 @@ module Rake
end end
end end
module Pod
FileList = Rake::FileList
end
class Pathname class Pathname
alias_method :_original_sum, :+ alias_method :_original_sum, :+
def +(other) def +(other)
......
require 'rubygems' require 'rubygems'
require 'mac_bacon' require 'bacon'
require 'pathname' require 'pathname'
ROOT = Pathname.new(File.expand_path('../../', __FILE__)) ROOT = Pathname.new(File.expand_path('../../', __FILE__))
$:.unshift File.expand_path('../../external/xcodeproj/ext', __FILE__)
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__) $:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift (ROOT + 'lib').to_s $:.unshift (ROOT + 'lib').to_s
require 'cocoapods' require 'cocoapods'
......
...@@ -4,7 +4,7 @@ describe "Pod::Downloader" do ...@@ -4,7 +4,7 @@ describe "Pod::Downloader" do
it "returns a git downloader" do it "returns a git downloader" do
downloader = Pod::Downloader.for_source( downloader = Pod::Downloader.for_source(
'/path/to/pod_root', '/path/to/pod_root',
:git => 'http://example.local/banana.git', :tag => 'v1.0', :git => 'http://example.local/banana.git', :tag => 'v1.0'
) )
downloader.should.be.instance_of Pod::Downloader::Git downloader.should.be.instance_of Pod::Downloader::Git
downloader.pod_root.should == '/path/to/pod_root' downloader.pod_root.should == '/path/to/pod_root'
......
...@@ -263,7 +263,7 @@ describe "A Pod::Specification, in general," do ...@@ -263,7 +263,7 @@ describe "A Pod::Specification, in general," do
@spec.platform.should == :ios @spec.platform.should == :ios
end end
it "returns the license of the Pods code" do it "returns the license of the Pod's code" do
@spec.license = 'MIT' @spec.license = 'MIT'
@spec.license.should == 'MIT' @spec.license.should == 'MIT'
end end
...@@ -274,10 +274,9 @@ describe "A Pod::Specification, in general," do ...@@ -274,10 +274,9 @@ describe "A Pod::Specification, in general," do
end end
it "takes any object for clean_paths as long as it responds to #glob (we provide this for Rake::FileList)" do it "takes any object for clean_paths as long as it responds to #glob (we provide this for Rake::FileList)" do
Pod::FileList # autoload @spec.clean_paths = Pod::FileList['*'].exclude('Rakefile')
@spec.clean_paths = FileList['*'].exclude('Rakefile')
list = ROOT + @spec.clean_paths.first list = ROOT + @spec.clean_paths.first
list.glob.should == FileList[(ROOT + '*').to_s].exclude('Rakefile').map { |path| Pathname.new(path) } list.glob.should == Pod::FileList[(ROOT + '*').to_s].exclude('Rakefile').map { |path| Pathname.new(path) }
end end
end end
......
...@@ -7,7 +7,7 @@ describe 'Xcodeproj::Project' do ...@@ -7,7 +7,7 @@ describe 'Xcodeproj::Project' do
def find_object(conditions) def find_object(conditions)
@project.objects_hash.select do |_, object| @project.objects_hash.select do |_, object|
object.objectsForKeys(conditions.keys, notFoundMarker:Object.new) == conditions.values (conditions.keys - object.keys).empty? && object.values_at(*conditions.keys) == conditions.values
end.first end.first
end end
......
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