Commit 9323fbac authored by Fabio Pelosin's avatar Fabio Pelosin

[Specs] Fix for reinitialization of constant.

The actual warning:
./spec/unit/sandbox_spec.rb:4: warning: already initialized constant TMP_POD_ROOT
Pod::Sandbox
parent d59409f6
require File.expand_path('../../spec_helper', __FILE__) require File.expand_path('../../spec_helper', __FILE__)
require 'tmpdir' require 'tmpdir'
TMP_POD_ROOT = ROOT + "tmp" + "podroot" TMP_POD_ROOT = ROOT + "tmp" + "podroot" unless defined? TMP_POD_ROOT
describe Pod::Sandbox do describe Pod::Sandbox do
before do before do
@sandbox = Pod::Sandbox.new(TMP_POD_ROOT) @sandbox = Pod::Sandbox.new(TMP_POD_ROOT)
end end
after do after do
@sandbox.implode @sandbox.implode
end end
it "automatically creates the TMP_POD_ROOT if it doesn't exist" do it "automatically creates the TMP_POD_ROOT if it doesn't exist" do
File.directory?(TMP_POD_ROOT).should.be.true File.directory?(TMP_POD_ROOT).should.be.true
end end
it "deletes the entire root directory on implode" do it "deletes the entire root directory on implode" do
@sandbox.implode @sandbox.implode
File.directory?(TMP_POD_ROOT).should.be.false File.directory?(TMP_POD_ROOT).should.be.false
FileUtils.mkdir(TMP_POD_ROOT) # put it back again FileUtils.mkdir(TMP_POD_ROOT) # put it back again
end end
it "returns it's headers root" do it "returns it's headers root" do
@sandbox.headers_root.should == Pathname.new(File.join(TMP_POD_ROOT, "Headers")) @sandbox.headers_root.should == Pathname.new(File.join(TMP_POD_ROOT, "Headers"))
end end
it "can add namespaced headers to it's header path using symlinks and return the relative path" do it "can add namespaced headers to it's header path using symlinks and return the relative path" do
FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers") FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers")
namespace_path = Pathname.new("ExampleLib") namespace_path = Pathname.new("ExampleLib")
...@@ -36,7 +36,7 @@ describe Pod::Sandbox do ...@@ -36,7 +36,7 @@ describe Pod::Sandbox do
symlink_path.should.be.symlink symlink_path.should.be.symlink
File.read(symlink_path).should == 'hello' File.read(symlink_path).should == 'hello'
end end
it 'can add multiple headers at once and return the relative symlink paths' do it 'can add multiple headers at once and return the relative symlink paths' do
FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers") FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers")
namespace_path = Pathname.new("ExampleLib") namespace_path = Pathname.new("ExampleLib")
...@@ -53,7 +53,7 @@ describe Pod::Sandbox do ...@@ -53,7 +53,7 @@ describe Pod::Sandbox do
File.read(path).should == "hello" File.read(path).should == "hello"
end end
end end
it 'keeps a list of unique header search paths when headers are added' do it 'keeps a list of unique header search paths when headers are added' do
FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers") FileUtils.mkdir_p(@sandbox.root + "ExampleLib/Headers")
namespace_path = Pathname.new("ExampleLib") namespace_path = Pathname.new("ExampleLib")
...@@ -67,11 +67,11 @@ describe Pod::Sandbox do ...@@ -67,11 +67,11 @@ describe Pod::Sandbox do
@sandbox.add_header_files(namespace_path, relative_header_paths) @sandbox.add_header_files(namespace_path, relative_header_paths)
@sandbox.header_search_paths.should.include("${PODS_ROOT}/Headers/ExampleLib") @sandbox.header_search_paths.should.include("${PODS_ROOT}/Headers/ExampleLib")
end end
it 'always adds the Headers root to the header search paths' do it 'always adds the Headers root to the header search paths' do
@sandbox.header_search_paths.should.include("${PODS_ROOT}/Headers") @sandbox.header_search_paths.should.include("${PODS_ROOT}/Headers")
end end
it 'clears out its headers root when preparing for install' do it 'clears out its headers root when preparing for install' do
@sandbox.prepare_for_install @sandbox.prepare_for_install
@sandbox.headers_root.should.not.exist @sandbox.headers_root.should.not.exist
......
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