Commit 270907f1 authored by Fabio Pelosin's avatar Fabio Pelosin

[Sandbox] Store support files per target

parent 9d99d3eb
...@@ -57,13 +57,10 @@ module Pod ...@@ -57,13 +57,10 @@ module Pod
library.target = @target library.target = @target
end end
# Creates the group that holds the references to the support files # Creates the directory where to store the support files of the target.
# generated by this installer.
# #
# @return [void] def create_support_files_dir
# library.support_files_dir.mkdir
def create_suport_files_group
@support_files_group = project.support_files_group.new_group(library.name)
end end
# Generates a dummy source file for each target so libraries that contain # Generates a dummy source file for each target so libraries that contain
......
...@@ -11,6 +11,7 @@ module Pod ...@@ -11,6 +11,7 @@ module Pod
def install! def install!
UI.message "- Installing target `#{library.name}` #{library.platform}" do UI.message "- Installing target `#{library.name}` #{library.platform}" do
add_target add_target
create_support_files_dir
create_suport_files_group create_suport_files_group
create_xcconfig_file create_xcconfig_file
create_target_environment_header create_target_environment_header
...@@ -25,6 +26,18 @@ module Pod ...@@ -25,6 +26,18 @@ module Pod
private private
# Creates the group that holds the references to the support files
# generated by this installer.
#
# @return [void]
#
def create_suport_files_group
parent = project.support_files_group
name = library.name
dir = library.support_files_dir
@support_files_group = parent.new_group(name, dir)
end
# Generates the contents of the xcconfig file and saves it to disk. # Generates the contents of the xcconfig file and saves it to disk.
# #
# @return [void] # @return [void]
......
...@@ -11,6 +11,7 @@ module Pod ...@@ -11,6 +11,7 @@ module Pod
def install! def install!
UI.message "- Installing target `#{library.name}` #{library.platform}" do UI.message "- Installing target `#{library.name}` #{library.platform}" do
add_target add_target
create_support_files_dir
add_files_to_build_phases add_files_to_build_phases
add_resources_bundle_targets add_resources_bundle_targets
create_xcconfig_file create_xcconfig_file
...@@ -186,7 +187,8 @@ module Pod ...@@ -186,7 +187,8 @@ module Pod
# #
def add_file_to_support_group(path) def add_file_to_support_group(path)
pod_name = library.pod_name pod_name = library.pod_name
group = project.pod_support_files_group(pod_name) dir = library.support_files_dir
group = project.pod_support_files_group(pod_name, dir)
group.new_file(path) group.new_file(path)
end end
......
...@@ -122,12 +122,11 @@ module Pod ...@@ -122,12 +122,11 @@ module Pod
# #
# @return [PBXGroup] The group. # @return [PBXGroup] The group.
# #
def pod_support_files_group(pod_name) def pod_support_files_group(pod_name, dir)
group = pod_group(pod_name) group = pod_group(pod_name)
support_files_group = group['Support Files'] support_files_group = group['Support Files']
unless support_files_group unless support_files_group
support_files_group = group.new_group('Support Files') support_files_group = group.new_group('Support Files', dir)
support_files_group.source_tree = 'SOURCE_ROOT'
end end
support_files_group support_files_group
end end
......
...@@ -132,8 +132,8 @@ module Pod ...@@ -132,8 +132,8 @@ module Pod
# #
# @return [Pathname] the path of the support files. # @return [Pathname] the path of the support files.
# #
def target_support_files_dir(_name) def target_support_files_dir(name)
target_support_files_root target_support_files_root + name
end end
# Returns the path where the Pod with the given name is stored, taking into # Returns the path where the Pod with the given name is stored, taking into
......
...@@ -71,8 +71,8 @@ module Pod ...@@ -71,8 +71,8 @@ module Pod
# @return [Pathname] the folder where to store the support files of this # @return [Pathname] the folder where to store the support files of this
# library. # library.
# #
def support_files_root def support_files_dir
@sandbox.target_support_files_dir(name) sandbox.target_support_files_dir(name)
end end
# @param [String] variant # @param [String] variant
...@@ -83,41 +83,42 @@ module Pod ...@@ -83,41 +83,42 @@ module Pod
# #
def xcconfig_path(variant = nil) def xcconfig_path(variant = nil)
if variant if variant
support_files_root + "#{label}.#{variant.downcase}.xcconfig" support_files_dir + "#{label}.#{variant.downcase}.xcconfig"
else else
support_files_root + "#{label}.xcconfig" support_files_dir + "#{label}.xcconfig"
end end
end end
# @return [Pathname] the absolute path of the private xcconfig file. # @return [Pathname] the absolute path of the private xcconfig file.
# #
def xcconfig_private_path def xcconfig_private_path
support_files_root + "#{label}-Private.xcconfig" support_files_dir + "#{label}-Private.xcconfig"
end end
# @return [Pathname] the absolute path of the header file which contains # @return [Pathname] the absolute path of the header file which contains
# the information about the installed pods. # the information about the installed pods.
# #
def target_environment_header_path def target_environment_header_path
support_files_root + "#{target_definition.label}-environment.h" name = target_definition.label
sandbox.target_support_files_dir(name) + "#{name}-environment.h"
end end
# @return [Pathname] the absolute path of the prefix header file. # @return [Pathname] the absolute path of the prefix header file.
# #
def prefix_header_path def prefix_header_path
support_files_root + "#{label}-prefix.pch" support_files_dir + "#{label}-prefix.pch"
end end
# @return [Pathname] the absolute path of the bridge support file. # @return [Pathname] the absolute path of the bridge support file.
# #
def bridge_support_path def bridge_support_path
support_files_root + "#{label}.bridgesupport" support_files_dir + "#{label}.bridgesupport"
end end
# @return [Pathname] the path of the dummy source generated by CocoaPods # @return [Pathname] the path of the dummy source generated by CocoaPods
# #
def dummy_source_path def dummy_source_path
support_files_root + "#{label}-dummy.m" support_files_dir + "#{label}-dummy.m"
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -102,13 +102,13 @@ module Pod ...@@ -102,13 +102,13 @@ module Pod
# the file type. # the file type.
# #
def acknowledgements_basepath def acknowledgements_basepath
support_files_root + "#{label}-acknowledgements" support_files_dir + "#{label}-acknowledgements"
end end
# @return [Pathname] The absolute path of the copy resources script. # @return [Pathname] The absolute path of the copy resources script.
# #
def copy_resources_script_path def copy_resources_script_path
support_files_root + "#{label}-resources.sh" support_files_dir + "#{label}-resources.sh"
end end
# @return [String] The xcconfig path of the root from the `$(SRCROOT)` # @return [String] The xcconfig path of the root from the `$(SRCROOT)`
......
...@@ -29,11 +29,13 @@ module Pod ...@@ -29,11 +29,13 @@ module Pod
end end
it 'returns the path of the prefix header' do it 'returns the path of the prefix header' do
@rep.prefix_header_path.should == temporary_directory + 'Pods/Target Support Files/Pods-MyApp-prefix.pch' @rep.prefix_header_path.should == temporary_directory +
'Pods/Target Support Files/Pods-MyApp/Pods-MyApp-prefix.pch'
end end
it 'returns the path of the copy resources script' do it 'returns the path of the copy resources script' do
@rep.copy_resources_script_path.should == temporary_directory + 'Pods/Target Support Files/Pods-MyApp-resources.sh' @rep.copy_resources_script_path.should == temporary_directory +
'Pods/Target Support Files/Pods-MyApp/Pods-MyApp-resources.sh'
end end
it 'returns the pods project' do it 'returns the pods project' do
......
...@@ -82,7 +82,7 @@ module Pod ...@@ -82,7 +82,7 @@ module Pod
'Pods-SVPullToRefresh', 'Pods-SVPullToRefresh',
'Pods-libextobjc', 'Pods-libextobjc',
].sort ].sort
target.support_files_root.should == config.sandbox.target_support_files_dir('Pods') target.support_files_dir.should == config.sandbox.target_support_files_dir('Pods')
target.user_project_path.to_s.should.include 'SampleProject/SampleProject' target.user_project_path.to_s.should.include 'SampleProject/SampleProject'
target.client_root.to_s.should.include 'SampleProject' target.client_root.to_s.should.include 'SampleProject'
......
...@@ -169,7 +169,7 @@ module Pod ...@@ -169,7 +169,7 @@ module Pod
build_files = @installer.library.target.source_build_phase.files build_files = @installer.library.target.source_build_phase.files
build_file = build_files.find { |bf| bf.file_ref.path.include?('Pods-dummy.m') } build_file = build_files.find { |bf| bf.file_ref.path.include?('Pods-dummy.m') }
build_file.should.be.not.nil build_file.should.be.not.nil
build_file.file_ref.path.should == 'Target Support Files/Pods-dummy.m' build_file.file_ref.path.should == 'Pods-dummy.m'
support_files_dir = config.sandbox.target_support_files_dir('Pods') support_files_dir = config.sandbox.target_support_files_dir('Pods')
dummy = support_files_dir + 'Pods-dummy.m' dummy = support_files_dir + 'Pods-dummy.m'
dummy.read.should.include?('@interface PodsDummy_Pods') dummy.read.should.include?('@interface PodsDummy_Pods')
......
...@@ -125,7 +125,7 @@ module Pod ...@@ -125,7 +125,7 @@ module Pod
it "creates a prefix header, including the contents of the specification's prefix header" do it "creates a prefix header, including the contents of the specification's prefix header" do
@spec.prefix_header_contents = '#import "BlocksKit.h"' @spec.prefix_header_contents = '#import "BlocksKit.h"'
@installer.install! @installer.install!
support_files_dir = config.sandbox.target_support_files_dir('Pods') support_files_dir = config.sandbox.target_support_files_dir('Pods-BananaLib')
prefix_header = support_files_dir + 'Pods-BananaLib-prefix.pch' prefix_header = support_files_dir + 'Pods-BananaLib-prefix.pch'
generated = prefix_header.read generated = prefix_header.read
expected = <<-EOS.strip_heredoc expected = <<-EOS.strip_heredoc
...@@ -145,8 +145,8 @@ module Pod ...@@ -145,8 +145,8 @@ module Pod
build_files = @installer.library.target.source_build_phase.files build_files = @installer.library.target.source_build_phase.files
build_file = build_files.find { |bf| bf.file_ref.display_name == 'Pods-BananaLib-dummy.m' } build_file = build_files.find { |bf| bf.file_ref.display_name == 'Pods-BananaLib-dummy.m' }
build_file.should.be.not.nil build_file.should.be.not.nil
build_file.file_ref.path.should == 'Target Support Files/Pods-BananaLib-dummy.m' build_file.file_ref.path.should == 'Pods-BananaLib-dummy.m'
support_files_dir = config.sandbox.target_support_files_dir('Pods') support_files_dir = config.sandbox.target_support_files_dir('Pods-BananaLib')
dummy = support_files_dir + 'Pods-BananaLib-dummy.m' dummy = support_files_dir + 'Pods-BananaLib-dummy.m'
dummy.read.should.include?('@interface PodsDummy_Pods') dummy.read.should.include?('@interface PodsDummy_Pods')
end end
......
...@@ -47,7 +47,7 @@ module Pod ...@@ -47,7 +47,7 @@ module Pod
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Copy Pods Resources' } phase = target.shell_script_build_phases.find { |bp| bp.name == 'Copy Pods Resources' }
phase.shell_script = %("${SRCROOT}/../Pods/Pods-resources.sh"\n) phase.shell_script = %("${SRCROOT}/../Pods/Pods-resources.sh"\n)
@target_integrator.integrate! @target_integrator.integrate!
phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods-resources.sh\"" phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\""
end end
it 'adds references to the Pods static libraries to the Frameworks group' do it 'adds references to the Pods static libraries to the Frameworks group' do
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
@target_integrator.integrate! @target_integrator.integrate!
target = @target_integrator.send(:native_targets).first target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Copy Pods Resources' } phase = target.shell_script_build_phases.find { |bp| bp.name == 'Copy Pods Resources' }
phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods-resources.sh\"" phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\""
end end
it 'adds a Check Manifest.lock build phase to each target' do it 'adds a Check Manifest.lock build phase to each target' do
......
...@@ -36,37 +36,37 @@ module Pod ...@@ -36,37 +36,37 @@ module Pod
end end
it 'returns the absolute path of the xcconfig file' do it 'returns the absolute path of the xcconfig file' do
@lib.xcconfig_path('Release').to_s.should.include?('Pods/Target Support Files/Pods.release.xcconfig') @lib.xcconfig_path('Release').to_s.should.include?('Pods/Target Support Files/Pods/Pods.release.xcconfig')
end end
it 'returns the absolute path of the resources script' do it 'returns the absolute path of the resources script' do
@lib.copy_resources_script_path.to_s.should.include?('Pods/Target Support Files/Pods-resources.sh') @lib.copy_resources_script_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-resources.sh')
end end
it 'returns the absolute path of the target header file' do it 'returns the absolute path of the target header file' do
@lib.target_environment_header_path.to_s.should.include?('Pods/Target Support Files/Pods-environment.h') @lib.target_environment_header_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-environment.h')
end end
it 'returns the absolute path of the prefix header file' do it 'returns the absolute path of the prefix header file' do
@lib.prefix_header_path.to_s.should.include?('Pods/Target Support Files/Pods-prefix.pch') @lib.prefix_header_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-prefix.pch')
end end
it 'returns the absolute path of the bridge support file' do it 'returns the absolute path of the bridge support file' do
@lib.bridge_support_path.to_s.should.include?('Pods/Target Support Files/Pods.bridgesupport') @lib.bridge_support_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods.bridgesupport')
end end
it 'returns the absolute path of the acknowledgements files without extension' do it 'returns the absolute path of the acknowledgements files without extension' do
@lib.acknowledgements_basepath.to_s.should.include?('Pods/Target Support Files/Pods-acknowledgements') @lib.acknowledgements_basepath.to_s.should.include?('Pods/Target Support Files/Pods/Pods-acknowledgements')
end end
#--------------------------------------# #--------------------------------------#
it 'returns the path of the resources script relative to the user project' do it 'returns the path of the resources script relative to the user project' do
@lib.copy_resources_script_relative_path.should == '${SRCROOT}/Pods/Target Support Files/Pods-resources.sh' @lib.copy_resources_script_relative_path.should == '${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh'
end end
it 'returns the path of the xcconfig file relative to the user project' do it 'returns the path of the xcconfig file relative to the user project' do
@lib.xcconfig_relative_path('Release').should == 'Pods/Target Support Files/Pods.release.xcconfig' @lib.xcconfig_relative_path('Release').should == 'Pods/Target Support Files/Pods/Pods.release.xcconfig'
end end
end end
......
...@@ -139,14 +139,13 @@ module Pod ...@@ -139,14 +139,13 @@ module Pod
end end
it 'creates a support file group relative to the project' do it 'creates a support file group relative to the project' do
group = @project.pod_support_files_group('BananaLib') group = @project.pod_support_files_group('BananaLib', 'path')
group.source_tree.should == 'SOURCE_ROOT' group.path.should == 'path'
group.path.should.be.nil
end end
it "doesn't duplicate the groups" do it "doesn't duplicate the groups" do
group_1 = @project.pod_support_files_group('BananaLib') group_1 = @project.pod_support_files_group('BananaLib', 'path')
group_2 = @project.pod_support_files_group('BananaLib') group_2 = @project.pod_support_files_group('BananaLib', 'path')
group_1.uuid.should == group_2.uuid group_1.uuid.should == group_2.uuid
end end
......
...@@ -33,7 +33,8 @@ module Pod ...@@ -33,7 +33,8 @@ module Pod
end end
it 'returns the public headers store' do it 'returns the public headers store' do
@sandbox.public_headers.root.should == temporary_directory + 'Sandbox/Headers/Public' @sandbox.public_headers.root.should ==
temporary_directory + 'Sandbox/Headers/Public'
end end
it 'cleans any trace of the Pod with the given name' do it 'cleans any trace of the Pod with the given name' do
...@@ -61,19 +62,23 @@ module Pod ...@@ -61,19 +62,23 @@ module Pod
describe 'Paths' do describe 'Paths' do
it 'returns the path of the manifest' do it 'returns the path of the manifest' do
@sandbox.manifest_path.should == temporary_directory + 'Sandbox/Manifest.lock' @sandbox.manifest_path.should ==
temporary_directory + 'Sandbox/Manifest.lock'
end end
it 'returns the path of the Pods project' do it 'returns the path of the Pods project' do
@sandbox.project_path.should == temporary_directory + 'Sandbox/Pods.xcodeproj' @sandbox.project_path.should ==
temporary_directory + 'Sandbox/Pods.xcodeproj'
end end
it 'returns the directory for the support files of a library' do it 'returns the directory for the support files of a library' do
@sandbox.target_support_files_dir('Pods').should == temporary_directory + 'Sandbox/Target Support Files' @sandbox.target_support_files_dir('Pods').should ==
temporary_directory + 'Sandbox/Target Support Files/Pods'
end end
it 'returns the directory where a Pod is stored' do it 'returns the directory where a Pod is stored' do
@sandbox.pod_dir('JSONKit').should == temporary_directory + 'Sandbox/Sources/JSONKit' @sandbox.pod_dir('JSONKit').should ==
temporary_directory + 'Sandbox/Sources/JSONKit'
end end
it 'returns the directory where a local Pod is stored' do it 'returns the directory where a local Pod is stored' do
...@@ -112,13 +117,15 @@ module Pod ...@@ -112,13 +117,15 @@ module Pod
end end
it 'returns the directory where to store the specifications' do it 'returns the directory where to store the specifications' do
@sandbox.specifications_root.should == temporary_directory + 'Sandbox/Local Podspecs' @sandbox.specifications_root.should ==
temporary_directory + 'Sandbox/Local Podspecs'
end end
it "returns the path to a spec file in the 'Local Podspecs' dir" do it "returns the path to a spec file in the 'Local Podspecs' dir" do
(@sandbox.root + 'Local Podspecs').mkdir (@sandbox.root + 'Local Podspecs').mkdir
FileUtils.cp(fixture('banana-lib/BananaLib.podspec'), @sandbox.root + 'Local Podspecs') FileUtils.cp(fixture('banana-lib/BananaLib.podspec'), @sandbox.root + 'Local Podspecs')
@sandbox.specification_path('BananaLib').should == @sandbox.root + 'Local Podspecs/BananaLib.podspec' @sandbox.specification_path('BananaLib').should ==
@sandbox.root + 'Local Podspecs/BananaLib.podspec'
end end
it 'stores a podspec with a given path into the sandbox' do it 'stores a podspec with a given path into the sandbox' do
......
...@@ -44,35 +44,35 @@ module Pod ...@@ -44,35 +44,35 @@ module Pod
end end
it 'returns the absolute path of the xcconfig file' do it 'returns the absolute path of the xcconfig file' do
@target.xcconfig_path('Release').to_s.should.include?('Pods/Target Support Files/Pods.release.xcconfig') @target.xcconfig_path('Release').to_s.should.include?('Pods/Target Support Files/Pods/Pods.release.xcconfig')
end end
it 'returns the absolute path of the resources script' do it 'returns the absolute path of the resources script' do
@target.copy_resources_script_path.to_s.should.include?('Pods/Target Support Files/Pods-resources.sh') @target.copy_resources_script_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-resources.sh')
end end
it 'returns the absolute path of the target header file' do it 'returns the absolute path of the target header file' do
@target.target_environment_header_path.to_s.should.include?('Pods/Target Support Files/Pods-environment.h') @target.target_environment_header_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-environment.h')
end end
it 'returns the absolute path of the prefix header file' do it 'returns the absolute path of the prefix header file' do
@target.prefix_header_path.to_s.should.include?('Pods/Target Support Files/Pods-prefix.pch') @target.prefix_header_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods-prefix.pch')
end end
it 'returns the absolute path of the bridge support file' do it 'returns the absolute path of the bridge support file' do
@target.bridge_support_path.to_s.should.include?('Pods/Target Support Files/Pods.bridgesupport') @target.bridge_support_path.to_s.should.include?('Pods/Target Support Files/Pods/Pods.bridgesupport')
end end
it 'returns the absolute path of the acknowledgements files without extension' do it 'returns the absolute path of the acknowledgements files without extension' do
@target.acknowledgements_basepath.to_s.should.include?('Pods/Target Support Files/Pods-acknowledgements') @target.acknowledgements_basepath.to_s.should.include?('Pods/Target Support Files/Pods/Pods-acknowledgements')
end end
it 'returns the path of the resources script relative to the user project' do it 'returns the path of the resources script relative to the user project' do
@target.copy_resources_script_relative_path.should == '${SRCROOT}/Pods/Target Support Files/Pods-resources.sh' @target.copy_resources_script_relative_path.should == '${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh'
end end
it 'returns the path of the xcconfig file relative to the user project' do it 'returns the path of the xcconfig file relative to the user project' do
@target.xcconfig_relative_path('Release').should == 'Pods/Target Support Files/Pods.release.xcconfig' @target.xcconfig_relative_path('Release').should == 'Pods/Target Support Files/Pods/Pods.release.xcconfig'
end end
end end
......
...@@ -54,32 +54,45 @@ module Pod ...@@ -54,32 +54,45 @@ module Pod
@target_definition.store_pod('BananaLib') @target_definition.store_pod('BananaLib')
@target_definition.store_pod('BananaLib/Subspec') @target_definition.store_pod('BananaLib/Subspec')
@target_definition.whitelist_pod_for_configuration('BananaLib', 'debug') @target_definition.whitelist_pod_for_configuration('BananaLib', 'debug')
should.raise Informative do message = should.raise Informative do
@pod_target.include_in_build_config?('release').should.be.true @pod_target.include_in_build_config?('release').should.be.true
end.message.should.match /subspecs across different build configurations/ end.message
message.should.match /subspecs across different build configurations/
end end
end end
describe 'Support files' do describe 'Support files' do
it 'returns the absolute path of the xcconfig file' do it 'returns the absolute path of the xcconfig file' do
@pod_target.xcconfig_path('Release').to_s.should.include 'Pods/Target Support Files/Pods-BananaLib.release.xcconfig' @pod_target.xcconfig_path('Release').to_s.should.include?(
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib.release.xcconfig'
)
end end
it 'returns the absolute path of the target header file' do it 'returns the absolute path of the target header file' do
@pod_target.target_environment_header_path.to_s.should.include 'Pods/Target Support Files/Pods-environment.h' @pod_target.target_environment_header_path.to_s.should.include?(
'Pods/Target Support Files/Pods/Pods-environment.h'
)
end end
it 'returns the absolute path of the prefix header file' do it 'returns the absolute path of the prefix header file' do
@pod_target.prefix_header_path.to_s.should.include 'Pods/Target Support Files/Pods-BananaLib-prefix.pch' @pod_target.prefix_header_path.to_s.should.include?(
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib-prefix.pch'
)
end end
it 'returns the absolute path of the bridge support file' do it 'returns the absolute path of the bridge support file' do
@pod_target.bridge_support_path.to_s.should.include 'Pods/Target Support Files/Pods-BananaLib.bridgesupport' @pod_target.bridge_support_path.to_s.should.include?(
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib.bridgesupport'
)
end end
it 'returns the absolute path of the public and private xcconfig files' do it 'returns the absolute path of the public and private xcconfig files' do
@pod_target.xcconfig_path.to_s.should.include 'Pods/Target Support Files/Pods-BananaLib.xcconfig' @pod_target.xcconfig_path.to_s.should.include?(
@pod_target.xcconfig_private_path.to_s.should.include 'Pods/Target Support Files/Pods-BananaLib-Private.xcconfig' 'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib.xcconfig'
)
@pod_target.xcconfig_private_path.to_s.should.include(
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib-Private.xcconfig'
)
end end
end end
......
...@@ -173,11 +173,17 @@ module Pod ...@@ -173,11 +173,17 @@ module Pod
describe 'Screenshot validation' do describe 'Screenshot validation' do
before do before do
@sut.stubs(:validate_homepage) @sut.stubs(:validate_homepage)
WebMock::API.stub_request(:head, 'banana-corp.local/valid-image.png').to_return(:status => 200, :headers => { 'Content-Type' => 'image/png' }) WebMock::API.
stub_request(:head, 'banana-corp.local/valid-image.png').
to_return({
:status => 200,
:headers => { 'Content-Type' => 'image/png' }
})
end end
it 'checks if the screenshots are valid' do it 'checks if the screenshots are valid' do
Specification.any_instance.stubs(:screenshots).returns(['http://banana-corp.local/valid-image.png']) Specification.any_instance.stubs(:screenshots).
returns(['http://banana-corp.local/valid-image.png'])
@sut.validate @sut.validate
@sut.results.should.be.empty? @sut.results.should.be.empty?
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