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

[Sandbox] Added #specification.

parent dad16075
...@@ -66,11 +66,8 @@ module Pod ...@@ -66,11 +66,8 @@ module Pod
# sandbox or by fetching the remote source, associated with the # sandbox or by fetching the remote source, associated with the
# external source. # external source.
# #
# TODO: rename to specification. def specification(sandbox)
# specification_from_local(sandbox) || specification_from_external(sandbox)
def specification_from_sandbox(sandbox)
specification_from_local(sandbox) ||
specification_from_external(sandbox)
end end
# @return [Specification] returns the specification associated with the # @return [Specification] returns the specification associated with the
......
...@@ -235,7 +235,7 @@ module Pod ...@@ -235,7 +235,7 @@ module Pod
if update_external_specs if update_external_specs
spec = source.specification_from_external(sandbox) spec = source.specification_from_external(sandbox)
else else
spec = source.specification_from_sandbox(sandbox) spec = source.specification(sandbox)
end end
set = Specification::Set::External.new(spec) set = Specification::Set::External.new(spec)
set set
......
...@@ -131,7 +131,7 @@ module Pod ...@@ -131,7 +131,7 @@ module Pod
# @param [String] name # @param [String] name
# the name of the Pod for which the specification is requested. # 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) def specification(name)
if file = podspec_for_name(name) if file = podspec_for_name(name)
......
...@@ -64,8 +64,15 @@ module Pod ...@@ -64,8 +64,15 @@ module Pod
] ]
end 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
end end
...@@ -146,7 +153,7 @@ module Pod ...@@ -146,7 +153,7 @@ module Pod
fss.subspec 'SecondSubSpec' fss.subspec 'SecondSubSpec'
end end
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 = Resolver.new(config.sandbox, @podfile)
resolver.resolve.values.flatten.map(&:name).sort.should == %w{ MainSpec/FirstSubSpec MainSpec/FirstSubSpec/SecondSubSpec } resolver.resolve.values.flatten.map(&:name).sort.should == %w{ MainSpec/FirstSubSpec MainSpec/FirstSubSpec/SecondSubSpec }
end 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