Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/xcodeproj/project/object/helpers/groupable_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def source_tree_real_path(object)
real_path(object_parent)
end
when 'SOURCE_ROOT'
object.project.project_dir
object.project.project_dir + object.project.root_object.project_dir_path
when '<absolute>'
nil
else
Expand Down
9 changes: 8 additions & 1 deletion spec/project/object/helpers/groupable_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,20 @@ module ProjectSpecs
@helper.source_tree_real_path(@group).should == Pathname.new('/project_dir')
end

it 'check project_dir_path adjustment' do
it 'check project_dir_path adjustment relative to main group' do
@group.source_tree = '<group>'
@project.root_object.stubs(:project_dir_path).returns('../')
@helper.source_tree_real_path(@group).to_s.should.not.include Pathname.new('/project_dir').to_s
Pathname.new('/project_dir').to_s.should.include @helper.source_tree_real_path(@group).to_s
end

it 'check project_dir_path adjustment relative to project root' do
@group.source_tree = 'SOURCE_ROOT'
@project.root_object.stubs(:project_dir_path).returns('../')
@helper.source_tree_real_path(@group).to_s.should.not.include Pathname.new('/project_dir').to_s
Pathname.new('/project_dir').to_s.should.include @helper.source_tree_real_path(@group).to_s
end

it 'returns the source tree of a path relative to a group' do
@group.source_tree = '<absolute>'
@group.path = '/parent_group_path'
Expand Down