Commit c229f47f authored by Fabio Pelosin's avatar Fabio Pelosin

[UserProjectIntegrator] Always return a Pathname in #workspace_path.

Closes #871
parent 03ab8617
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
- CocoaPods updates the repositories by default. - CocoaPods updates the repositories by default.
[#872](https://github.com/CocoaPods/CocoaPods/issues/872) [#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 ###### Ancillary enhancements
......
...@@ -132,18 +132,17 @@ module Pod ...@@ -132,18 +132,17 @@ module Pod
end end
end end
#-----------------------------------------------------------------------#
private private
# @!group Helpers. # @!group Private Helpers
#-----------------------------------------------------------------------#
# @return [Pathname] the path where the workspace containing the Pods # @return [Pathname] the path where the workspace containing the Pods
# project and the user projects should be saved. # project and the user projects should be saved.
# #
def workspace_path def workspace_path
if podfile.workspace_path if podfile.workspace_path
podfile.workspace_path Pathname.new(podfile.workspace_path)
elsif user_project_paths.count == 1 elsif user_project_paths.count == 1
project = user_project_paths.first.basename('.xcodeproj') project = user_project_paths.first.basename('.xcodeproj')
installation_root + "#{project}.xcworkspace" installation_root + "#{project}.xcworkspace"
......
...@@ -122,12 +122,12 @@ module Pod ...@@ -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 it "uses the path of the workspace defined in the podfile" do
path = "a_path" path = Pathname.new("a_path")
@podfile.workspace(path) @podfile.workspace(path.to_s)
@integrator.send(:workspace_path).should == path + ".xcworkspace" @integrator.send(:workspace_path).should == path.sub_ext(".xcworkspace")
end end
it "names the workspace after the user project if needed" do it "names the workspace after the user project if needed" do
......
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