Commit edc236c0 authored by Eloy Duran's avatar Eloy Duran

Make specs green.

parent 3f4ed2ad
...@@ -51,7 +51,7 @@ describe "Pod::Command" do ...@@ -51,7 +51,7 @@ describe "Pod::Command" do
spec.authors.should == { `git config --get user.name`.strip => `git config --get user.email`.strip } spec.authors.should == { `git config --get user.name`.strip => `git config --get user.email`.strip }
spec.source.should == { :git => 'http://example.com/Bananas.git', :tag => '1.0.0' } spec.source.should == { :git => 'http://example.com/Bananas.git', :tag => '1.0.0' }
spec.description.should == 'An optional longer description of Bananas.' spec.description.should == 'An optional longer description of Bananas.'
spec.source_files.should == [Pathname.new('Classes'), Pathname.new('Classes/**/*.{h,m}')] spec.source_files.should == ['Classes', 'Classes/**/*.{h,m}']
spec.xcconfig.to_hash.should == { 'OTHER_LDFLAGS' => '-framework SomeRequiredFramework' } spec.xcconfig.to_hash.should == { 'OTHER_LDFLAGS' => '-framework SomeRequiredFramework' }
spec.dependencies.should == [Pod::Dependency.new('SomeLibraryThatBananasDependsOn', '>= 1.0.0')] spec.dependencies.should == [Pod::Dependency.new('SomeLibraryThatBananasDependsOn', '>= 1.0.0')]
end end
......
...@@ -109,8 +109,10 @@ else ...@@ -109,8 +109,10 @@ else
installer = SpecHelper::Installer.new(spec) installer = SpecHelper::Installer.new(spec)
installer.install! installer.install!
installer = Pod::Installer.new(spec)
installer.generate_project
project = Pod::Xcode::Project.new(config.project_pods_root) project = Pod::Xcode::Project.new(config.project_pods_root)
project.source_files.sort.should == Pod::Installer.new(spec).source_files.sort project.source_files.should == installer.xcodeproj.source_files
end end
end end
end end
......
...@@ -60,29 +60,17 @@ describe "Pod::Installer" do ...@@ -60,29 +60,17 @@ describe "Pod::Installer" do
s.dependency(name) s.dependency(name)
s.source_files = *patterns s.source_files = *patterns
end) end)
destroot = stubbed_destroot(installer)
installer.generate_project installer.generate_project
expected_patterns.each do |name, pattern| expected_patterns.each do |name, pattern|
expected = (destroot + pattern).glob.map do |file| pattern = config.project_pods_root + 'ASIHTTPRequest' + pattern
expected = pattern.glob.map do |file|
file.relative_path_from(config.project_pods_root) file.relative_path_from(config.project_pods_root)
end end
installer.source_files[name].size.should == expected.size
installer.source_files[name].sort.should == expected.sort
installer.xcodeproj.source_files[name].size.should == expected.size installer.xcodeproj.source_files[name].size.should == expected.size
installer.xcodeproj.source_files[name].sort.should == expected.sort installer.xcodeproj.source_files[name].sort.should == expected.sort
end end
installer.xcconfig.to_hash.should == xcconfig installer.xcconfig.to_hash.should == xcconfig
end end
end end
def stubbed_destroot(installer)
set = installer.dependent_specification_sets.find { |s| s.name == 'ASIHTTPRequest' }
spec = set.specification
set.extend(Module.new { define_method(:specification) { spec }})
def spec.pod_destroot
config.project_pods_root + 'ASIHTTPRequest' # without name and version
end
spec.pod_destroot
end
end end
...@@ -79,10 +79,7 @@ describe "A Pod::Specification loaded from a podspec" do ...@@ -79,10 +79,7 @@ describe "A Pod::Specification loaded from a podspec" do
end end
it "returns the pod's source files" do it "returns the pod's source files" do
@spec.source_files.should == [ @spec.source_files.should == ['Classes/*.{h,m}', 'Vendor']
Pathname.new('Classes/*.{h,m}'),
Pathname.new('Vendor')
]
end end
it "returns the pod's dependencies" do it "returns the pod's dependencies" do
...@@ -109,7 +106,7 @@ describe "A Pod::Specification loaded from a podspec" do ...@@ -109,7 +106,7 @@ describe "A Pod::Specification loaded from a podspec" do
it "has a shortcut to add libraries to the xcconfig" do it "has a shortcut to add libraries to the xcconfig" do
@spec.libraries = 'z', 'xml2' @spec.libraries = 'z', 'xml2'
@spec.xcconfig.to_hash.should == { @spec.xcconfig.to_hash.should == {
'OTHER_LDFLAGS' => '-framework SystemConfiguration -l z -l xml2' 'OTHER_LDFLAGS' => '-framework SystemConfiguration -lz -lxml2'
} }
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