Skip to content

Commit

Permalink
[UserProjectIntegrator] Always return a Pathname in #workspace_path.
Browse files Browse the repository at this point in the history
Closes #871
  • Loading branch information
fabiopelosin committed Mar 19, 2013
1 parent 03ab861 commit c229f47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- CocoaPods updates the repositories by default.
[#872](https://github.com/CocoaPods/CocoaPods/issues/872)
- Fixed a crash which was present when the Podfile specifies a workspace.
[#871](https://github.com/CocoaPods/CocoaPods/issues/871)

###### Ancillary enhancements

Expand Down
7 changes: 3 additions & 4 deletions lib/cocoapods/installer/user_project_integrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,17 @@ def warn_about_empty_podfile
end
end

#-----------------------------------------------------------------------#

private

# @!group Helpers.
# @!group Private Helpers
#-----------------------------------------------------------------------#

# @return [Pathname] the path where the workspace containing the Pods
# project and the user projects should be saved.
#
def workspace_path
if podfile.workspace_path
podfile.workspace_path
Pathname.new(podfile.workspace_path)
elsif user_project_paths.count == 1
project = user_project_paths.first.basename('.xcodeproj')
installation_root + "#{project}.xcworkspace"
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/installer/user_project_integrator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ module Pod

#-----------------------------------------------------------------------#

describe "Helpers" do
describe "Private Helpers" do

it "uses the path of the workspace defined in the podfile" do
path = "a_path"
@podfile.workspace(path)
@integrator.send(:workspace_path).should == path + ".xcworkspace"
path = Pathname.new("a_path")
@podfile.workspace(path.to_s)
@integrator.send(:workspace_path).should == path.sub_ext(".xcworkspace")
end

it "names the workspace after the user project if needed" do
Expand Down

0 comments on commit c229f47

Please sign in to comment.