Commit 19e1ceb3 authored by Fabio Pelosin's avatar Fabio Pelosin

[Specs] fix syntax.

parent d44e0feb
...@@ -10,28 +10,26 @@ describe Pod::LocalPod do ...@@ -10,28 +10,26 @@ describe Pod::LocalPod do
@pod = Pod::LocalPod.new(@spec, @sandbox, Pod::Platform.new(:ios)) @pod = Pod::LocalPod.new(@spec, @sandbox, Pod::Platform.new(:ios))
copy_fixture_to_pod('banana-lib', @pod) copy_fixture_to_pod('banana-lib', @pod)
end end
end
it "can link it's headers into the sandbox" do it "can link it's headers into the sandbox" do
@pod.link_headers @pod.link_headers
expected_header_path = @sandbox.build_headers.root + "BananaLib/Banana.h" expected_header_path = @sandbox.build_headers.root + "BananaLib/Banana.h"
expected_header_path.should.be.symlink expected_header_path.should.be.symlink
File.read(expected_header_path).should == (@sandbox.root + @pod.header_files[0]).read File.read(expected_header_path).should == (@sandbox.root + @pod.header_files[0]).read
end end
it "can add it's source files to an Xcode project target" do it "can add it's source files to an Xcode project target" do
target = mock('target') target = mock('target')
target.expects(:add_source_file).with(Pathname.new("BananaLib/Classes/Banana.m"), anything, anything) target.expects(:add_source_file).with(Pathname.new("BananaLib/Classes/Banana.m"), anything, anything)
@pod.add_to_target(target) @pod.add_to_target(target)
end end
it "can add it's source files to a target with any specially configured compiler flags" do it "can add it's source files to a target with any specially configured compiler flags" do
@pod.specification.compiler_flags = '-d some_flag' @pod.specification.compiler_flags = '-d some_flag'
target = mock('target') target = mock('target')
target.expects(:add_source_file).with(anything, anything, "-d some_flag") target.expects(:add_source_file).with(anything, anything, "-d some_flag")
@pod.add_to_target(target) @pod.add_to_target(target)
end end
end
it 'returns the Pod root directory path' do it 'returns the Pod root directory path' do
@pod.root.should == @sandbox.root + 'BananaLib' @pod.root.should == @sandbox.root + 'BananaLib'
...@@ -72,6 +70,16 @@ end ...@@ -72,6 +70,16 @@ end
@pod.relative_header_files.should == [Pathname.new("BananaLib/Classes/Banana.h")] @pod.relative_header_files.should == [Pathname.new("BananaLib/Classes/Banana.h")]
end end
xit "returns the user header search paths" do
def @spec.copy_header_mapping(from)
Pathname.new('ns') + from.basename
end
@spec.build_headers.search_paths.should == %w{
"$(PODS_ROOT)/Headers/SSZipArchive"
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
}
end
it 'returns a list of header files by specification' do it 'returns a list of header files by specification' do
files = @pod.header_files_by_spec[@pod.specifications.first].sort files = @pod.header_files_by_spec[@pod.specifications.first].sort
files.should == [ @pod.root + "Classes/Banana.h" ] files.should == [ @pod.root + "Classes/Banana.h" ]
...@@ -116,21 +124,10 @@ end ...@@ -116,21 +124,10 @@ end
@pod.platform.should == :ios @pod.platform.should == :ios
end end
@spec.build_headers.search_paths.should == %w{
"$(PODS_ROOT)/Headers/SSZipArchive"
"$(PODS_ROOT)/Headers/SSZipArchive/ns"
}
end
it "raises if the files are accessed before creating the pod dir" do it "raises if the files are accessed before creating the pod dir" do
@pod.implode @pod.implode
lambda { @pod.source_files }.should.raise Pod::Informative lambda { @pod.source_files }.should.raise Pod::Informative
end end
@spec.build_headers.search_paths.should == %w{
"$(PODS_ROOT)/Headers/AnotherRoot"
"$(PODS_ROOT)/Headers/AnotherRoot/ns"
}
end end
describe "with installed source and multiple subspecs" do describe "with installed source and multiple subspecs" do
...@@ -259,7 +256,6 @@ end ...@@ -259,7 +256,6 @@ end
assert_array_equals(expected, computed) assert_array_equals(expected, computed)
end end
it "resolved the header files" do it "resolved the header files" do
expected = %w[ expected = %w[
Chameleon/UIKit/Classes/UIKit.h Chameleon/UIKit/Classes/UIKit.h
......
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