Commit 7777824e authored by Tim Bodeit's avatar Tim Bodeit

[ProjectSpec] Add #reference_for_path specs for localized files

parent 7aca9755
......@@ -164,6 +164,7 @@ module Pod
@project.add_pod_group('BananaLib', config.sandbox.pod_dir('BananaLib'), false)
@file = config.sandbox.pod_dir('BananaLib') + 'file.m'
@nested_file = config.sandbox.pod_dir('BananaLib') + 'Dir/SubDir/nested_file.m'
@localized_file = config.sandbox.pod_dir('BananaLib') + 'Dir/SubDir/de.lproj/Foo.strings'
@group = @project.group_for_spec('BananaLib')
end
......@@ -194,6 +195,18 @@ module Pod
@group.children.count.should == 1
end
it 'creates variant group for localized file' do
ref = @project.add_file_reference(@localized_file, @group)
ref.hierarchy_path.should == '/Pods/BananaLib/Foo/Foo.strings'
ref.parent.class.should == Xcodeproj::Project::Object::PBXVariantGroup
end
it 'creates variant group for localized file in subgroup' do
ref = @project.add_file_reference(@localized_file, @group, true)
ref.hierarchy_path.should == '/Pods/BananaLib/Dir/SubDir/Foo/Foo.strings'
ref.parent.class.should == Xcodeproj::Project::Object::PBXVariantGroup
end
it 'raises if the given path is not absolute' do
should.raise ArgumentError do
@project.add_file_reference('relative/path/to/file.m', @group)
......
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