Commit 3f54a47d authored by AliSoftware's avatar AliSoftware

[xcassets] Fix / Deactivate some specs no longer relevant

parent 0e297f05
......@@ -113,7 +113,11 @@ module Pod
resources_by_config = {}
target.user_build_configurations.keys.each do |config|
file_accessors = library_targets.select { |t| t.include_in_build_config?(config) }.flat_map(&:file_accessors)
resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle" } }
resource_bundles = file_accessors.flat_map do |accessor|
accessor.resource_bundles.keys.map do |name|
Pathname.new "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle"
end
end
resources_by_config[config] = resource_bundles.uniq
resources_by_config[config] << bridge_support_file if bridge_support_file
end
......
require File.expand_path('../../../spec_helper', __FILE__)
# TODO: The Copy Resources Script is soon to be deprecated with PR #3263
# We probably will remove all those family of specs
#
module Pod
describe Generator::CopyResourcesScript do
it 'returns the copy resources script' do
xit 'returns the copy resources script' do
resources = { 'Release' => ['path/to/resource.png'] }
generator = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '6.0'))
generator.send(:script).should.include 'path/to/resource.png'
generator.send(:script).should.include 'storyboard'
end
it 'instructs ibtool to use the --reference-external-strings-file if set to do so' do
xit 'instructs ibtool to use the --reference-external-strings-file if set to do so' do
resources = { 'Release' => ['path/to/resource.png'] }
generator_1 = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '4.0'))
generator_2 = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '6.0'))
......@@ -18,7 +21,7 @@ module Pod
generator_2.send(:script).should.include '--reference-external-strings-file'
end
it 'adds configuration dependent resources with a call wrapped in an if statement' do
xit 'adds configuration dependent resources with a call wrapped in an if statement' do
resources = { 'Debug' => %w(Lookout.framework) }
generator = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '6.0'))
script = generator.send(:script)
......@@ -29,7 +32,7 @@ module Pod
eos
end
it 'adds resource bundles with a call wrapped in an if statement' do
xit 'adds resource bundles with a call wrapped in an if statement' do
resources = { 'Debug' => %w(${BUILT_PRODUCTS_DIR}/Resources.bundle) }
generator = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '6.0'))
script = generator.send(:script)
......
......@@ -42,7 +42,10 @@ module Pod
file_ref.path.should == 'libBananalib.a'
end
it 'adds the files references of the resources the Pods project' do
# TODO: Remove this as PR #3263 does not add the resources to the Pods project anymore
# But we should replace this with a spec that tests that resources are added
# to the User's project instead
xit 'adds the files references of the resources the Pods project' do
@installer.install!
file_ref = @installer.pods_project['Pods/BananaLib/Resources/logo-sidebar.png']
file_ref.should.be.not.nil
......
......@@ -134,7 +134,8 @@ module Pod
@installer.install!
end
it 'creates a create copy resources script' do
# TODO: Remove this; the Copy Resources Script will soon be obsoleted by PR #3263
xit 'creates a create copy resources script' do
@installer.install!
support_files_dir = config.sandbox.target_support_files_dir('Pods')
script = support_files_dir + 'Pods-resources.sh'
......@@ -166,16 +167,17 @@ module Pod
it 'uniques resources by config' do
a_path = Pathname.new(@project.path.dirname + '/duplicated/path.jpg')
a_bundle_name = 'banana'
duplicated_paths = [a_path, a_path]
@installer.target.pod_targets.each do |pod_target|
pod_target.file_accessors.each do |accessor|
accessor.stubs(:resources => duplicated_paths)
accessor.stubs(:resource_bundles => { a_bundle_name => duplicated_paths })
end
end
resources_by_config = @installer.send(:resources_by_config)
resources_by_config.each_value do |resources|
resources.length.should == 1
resources[0].basename.should == a_path.basename
resources[0].basename.to_s.should == a_bundle_name + '.bundle'
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