Commit fbcb700b authored by Fabio Pelosin's avatar Fabio Pelosin

[LocalSource] Specs.

parent 9e8c7b56
...@@ -323,4 +323,57 @@ describe Pod::LocalPod do ...@@ -323,4 +323,57 @@ describe Pod::LocalPod do
public_headers.should == %w{ UIKit.h } public_headers.should == %w{ UIKit.h }
end end
end end
describe "concerning a Pod with a local source" do
extend SpecHelper::TemporaryDirectory
before do
@local_path = temporary_directory + 'localBanana'
@sandbox = temporary_sandbox
@spec = fixture_spec('banana-lib/BananaLib.podspec')
@spec.source = {:local => @local_path}
@pod = Pod::LocalPod::LocalSourcedPod.new(@spec, @sandbox, Pod::Platform.new(:ios))
end
it "is marked as local" do
@pod.to_s.should.include? '[LOCAL]'
end
it "is marked as downloaded" do
@pod.downloaded?.should.be.true
end
it "correctly repports the root of the pod" do
@pod.root.should == @local_path
end
it "doesn't create the root" do
@pod.create
@local_path.exist?.should.be.false
end
before do
FileUtils.cp_r(fixture('banana-lib'), @local_path)
end
it "doesn't cleans the user files" do
useless_file = @local_path + 'useless.txt'
FileUtils.touch (useless_file)
@pod.root.should == @local_path
@pod.clean!
useless_file.exist?.should.be.true
end
it "doesn't implode" do
@pod.implode
@local_path.exist?.should.be.true
end
it "detects the files of the pod" do
@pod.source_files.map {|path| path.to_s.gsub(/.*tmp\//,'') }.sort.should == [
"localBanana/Classes/Banana.m",
"localBanana/Classes/Banana.h"
].sort
end
end
end end
...@@ -230,6 +230,12 @@ describe "A Pod::Specification, in general," do ...@@ -230,6 +230,12 @@ describe "A Pod::Specification, in general," do
@spec.platform = :ios @spec.platform = :ios
@spec.activate_platform(:ios).should == @spec @spec.activate_platform(:ios).should == @spec
end end
it "it handles local sources" do
@spec.activate_platform(:ios)
@spec.source = {:local => '/tmp/local/path'}
@spec.local?.should.be.true
end
end end
describe "A Pod::Specification, hierarchy" do describe "A Pod::Specification, hierarchy" do
......
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