Commit 3dc86c87 authored by Eloy Durán's avatar Eloy Durán

For some unknown reason, the Pods group was created twice sometimes.

Fixes: https://secure.travis-ci.org/#!/CocoaPods/CocoaPods/jobs/2236387
parent adb053f1
......@@ -31,12 +31,12 @@ module Pod
# Shortcut access to the `Pods' PBXGroup.
def pods
groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' })
@pods ||= groups.where(:name => 'Pods') || groups.new('name' => 'Pods')
end
# Shortcut access to the `Local Pods' PBXGroup.
def local_pods
groups.find { |g| g.name == 'Local Pods' } || groups.new({ 'name' => 'Local Pods' })
@local_pods ||= groups.where(:name => 'Local Pods') || groups.new('name' => 'Local Pods')
end
# Adds a group as child to the `Pods' group namespacing subspecs.
......@@ -44,7 +44,7 @@ module Pod
groups = parent_group.groups
group = nil
name.split('/').each do |name|
group = groups.find { |g| g.name == name } || groups.new('name' => name)
group = groups.where(:name => name) || groups.new('name' => name)
groups = group.groups
end
group
......
......@@ -71,12 +71,12 @@ module Pod
it "adds the files of the pod to the Pods project only once" do
@installer.install!
group = @installer.project.pods.groups.find{|g| g.name == 'Reachability'}
group = @installer.project.pods.groups.where(:name => 'Reachability')
group.files.map(&:name).should == ["Reachability.h", "Reachability.m"]
end
it "lists a pod only once" do
reachability_pods = @installer.pods.map(&:to_s).select{|s| s.include?('Reachability') }
reachability_pods = @installer.pods.map(&:to_s).select { |s| s.include?('Reachability') }
reachability_pods.count.should == 1
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