Commit d691d0bb authored by Fabio Pelosin's avatar Fabio Pelosin

Clean-up

parent 602d23f6
......@@ -36,11 +36,11 @@ module Pod
add_resources
end
#-----------------------------------------------------------------------#
private
# @!group Installation Steps
#---------------------------------------------------------------------#
# Reads the file accessors contents from the file system.
#
......@@ -103,17 +103,11 @@ module Pod
end
#-----------------------------------------------------------------------#
private
# @!group Private Helpers
#---------------------------------------------------------------------#
# TODO
#
def pods_project
sandbox.project
end
# @return [Array<Sandbox::FileAccessor>] The file accessors for all the
# specs platform combinations.
......@@ -138,15 +132,15 @@ module Pod
file_accessors.each do |file_accessor|
paths = file_accessor.send(file_accessor_key)
paths.each do |path|
group = pods_project.group_for_spec(file_accessor.spec.name, group_key)
pods_project.add_file_reference(path, group)
group = sandbox.project.group_for_spec(file_accessor.spec.name, group_key)
sandbox.project.add_file_reference(path, group)
end
end
end
#-----------------------------------------------------------------------#
#---------------------------------------------------------------------#
end
end
end
end
end
......@@ -25,11 +25,11 @@ module Pod
@library = library
end
private
#-----------------------------------------------------------------------#
private
# @!group Installation steps
#---------------------------------------------------------------------#
# Adds the target for the library to the Pods project with the
# appropriate build configurations.
......@@ -90,11 +90,11 @@ module Pod
#
attr_reader :target
private
#-----------------------------------------------------------------------#
private
# @!group Private helpers.
#---------------------------------------------------------------------#
# @return [Project] the Pods project of the sandbox.
#
......@@ -128,6 +128,6 @@ module Pod
end
end
end
end
end
......@@ -9,7 +9,7 @@ module Pod
@pod_target.file_accessors = [@file_accessor]
config.sandbox.project = Project.new(config.sandbox.project_path)
config.sandbox.project.add_pod_group('BananaLib', fixture('banana-lib'))
@installer = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [@pod_target])
@sut = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [@pod_target])
end
#-------------------------------------------------------------------------#
......@@ -19,18 +19,18 @@ module Pod
it "adds the files references of the source files the Pods project" do
@file_accessor.path_list.read_file_system
@file_accessor.path_list.expects(:read_file_system)
@installer.install!
@sut.install!
end
it "adds the files references of the source files the Pods project" do
@installer.install!
@sut.install!
file_ref = config.sandbox.project['Pods/BananaLib/Source Files/Banana.m']
file_ref.should.be.not.nil
file_ref.path.should == "Classes/Banana.m"
end
it "adds the file references of the frameworks of the project" do
@installer.install!
@sut.install!
group = config.sandbox.project.group_for_spec('BananaLib', :frameworks_and_libraries)
file_ref = group['Bananalib.framework']
file_ref.should.be.not.nil
......@@ -38,7 +38,7 @@ module Pod
end
it "adds the file references of the libraries of the project" do
@installer.install!
@sut.install!
group = config.sandbox.project.group_for_spec('BananaLib', :frameworks_and_libraries)
file_ref = group['libBananalib.a']
file_ref.should.be.not.nil
......@@ -46,7 +46,7 @@ module Pod
end
it "adds the files references of the resources the Pods project" do
@installer.install!
@sut.install!
file_ref = config.sandbox.project['Pods/BananaLib/Resources/logo-sidebar.png']
file_ref.should.be.not.nil
file_ref.path.should == "Resources/logo-sidebar.png"
......@@ -64,23 +64,23 @@ module Pod
pod_target_1.file_accessors = [fixture_file_accessor('banana-lib/BananaLib.podspec')]
pod_target_2 = PodTarget.new([], nil, config.sandbox)
pod_target_2.file_accessors = [fixture_file_accessor('banana-lib/BananaLib.podspec')]
installer = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [pod_target_1, pod_target_2])
roots = installer.send(:file_accessors).map { |fa| fa.path_list.root }
@sut = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [pod_target_1, pod_target_2])
roots = @sut.send(:file_accessors).map { |fa| fa.path_list.root }
roots.should == [fixture('banana-lib'), fixture('banana-lib')]
end
it "handles libraries empty libraries without file accessors" do
pod_target_1 = PodTarget.new([], nil, config.sandbox)
pod_target_1.file_accessors = []
installer = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [pod_target_1])
roots = installer.send(:file_accessors).should == []
@sut = Installer::PodsProjectGenerator::FileReferencesInstaller.new(config.sandbox, [pod_target_1])
roots = @sut.send(:file_accessors).should == []
end
end
describe "#add_file_accessors_paths_to_pods_group" do
it "adds the paths of the paths of the file accessor corresponding to the given key to the Pods project" do
@installer.send(:add_file_accessors_paths_to_pods_group, :source_files, :source_files)
@sut.send(:add_file_accessors_paths_to_pods_group, :source_files, :source_files)
group = config.sandbox.project.group_for_spec('BananaLib', :source_files)
group.children.map(&:name).sort.should == ["Banana.h", "Banana.m", "BananaPrivate.h"]
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