Commit 6ca43bce authored by Fabio Pelosin's avatar Fabio Pelosin

[Sandbox] Added #specification.

parent dad16075
......@@ -66,11 +66,8 @@ module Pod
# sandbox or by fetching the remote source, associated with the
# external source.
#
# TODO: rename to specification.
#
def specification_from_sandbox(sandbox)
specification_from_local(sandbox) ||
specification_from_external(sandbox)
def specification(sandbox)
specification_from_local(sandbox) || specification_from_external(sandbox)
end
# @return [Specification] returns the specification associated with the
......@@ -267,7 +264,7 @@ module Pod
path = Pathname.new(@params[:local]).expand_path
path += "#{name}.podspec"# unless path.to_s.include?("#{name}.podspec")
unless path.exist?
raise Informative, "No podspec found for `#{name}` in `#{@params[:local]}`"
raise Informative, "No podspec found for `#{name}` in `#{@params[:local]}`"
end
path
end
......
......@@ -235,7 +235,7 @@ module Pod
if update_external_specs
spec = source.specification_from_external(sandbox)
else
spec = source.specification_from_sandbox(sandbox)
spec = source.specification(sandbox)
end
set = Specification::Set::External.new(spec)
set
......
......@@ -131,7 +131,7 @@ module Pod
# @param [String] name
# the name of the Pod for which the specification is requested.
#
# @return [Specification] the specification.
# @return [Specification] the specification if the file is found.
#
def specification(name)
if file = podspec_for_name(name)
......
......@@ -64,8 +64,15 @@ module Pod
]
end
xit "returns the specifications that originated from external sources" do
it "it resolves specifications from external sources" do
podspec = fixture('integration/Reachability/Reachability.podspec')
podfile = Podfile.new do
platform :ios
pod "Reachability", :podspec => podspec
end
resolver = Resolver.new(config.sandbox, podfile)
resolver.resolve
resolver.specs.map(&:to_s).should == ['Reachability (3.0.0)']
end
end
......@@ -146,7 +153,7 @@ module Pod
fss.subspec 'SecondSubSpec'
end
end
ExternalSources::GitSource.any_instance.stubs(:specification_from_sandbox).returns(spec)
ExternalSources::GitSource.any_instance.stubs(:specification).returns(spec)
resolver = Resolver.new(config.sandbox, @podfile)
resolver.resolve.values.flatten.map(&:name).sort.should == %w{ MainSpec/FirstSubSpec MainSpec/FirstSubSpec/SecondSubSpec }
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