Commit 6b697111 authored by Marius Rackwitz's avatar Marius Rackwitz

[Spec] Fix spec helpers

parent a738212b
...@@ -109,10 +109,9 @@ def fixture_spec(name) ...@@ -109,10 +109,9 @@ def fixture_spec(name)
Pod::Specification.from_file(file) Pod::Specification.from_file(file)
end end
def fixture_file_accessor(name, platform = :ios) def fixture_file_accessor(spec_or_name, platform = :ios)
file = SpecHelper::Fixture.fixture(name) spec = spec_or_name.is_a?(Pod::Specification) ? spec_or_name : fixture_spec(spec_or_name)
spec = Pod::Specification.from_file(file) path_list = Pod::Sandbox::PathList.new(spec.defined_in_file.dirname)
path_list = Pod::Sandbox::PathList.new(file.dirname)
Pod::Sandbox::FileAccessor.new(path_list, spec.consumer(platform)) Pod::Sandbox::FileAccessor.new(path_list, spec.consumer(platform))
end end
...@@ -127,7 +126,7 @@ def fixture_pod_target(spec_or_name, platform = :ios, target_definition = nil) ...@@ -127,7 +126,7 @@ def fixture_pod_target(spec_or_name, platform = :ios, target_definition = nil)
target_definition.store_pod(spec.name) target_definition.store_pod(spec.name)
Pod::PodTarget.new([spec], [target_definition], config.sandbox).tap do |pod_target| Pod::PodTarget.new([spec], [target_definition], config.sandbox).tap do |pod_target|
pod_target.stubs(:platform).returns(platform) pod_target.stubs(:platform).returns(platform)
pod_target.file_accessors << fixture_file_accessor(spec.defined_in_file, platform) pod_target.file_accessors << fixture_file_accessor(spec, platform)
consumer = spec.consumer(platform) consumer = spec.consumer(platform)
pod_target.spec_consumers << consumer pod_target.spec_consumers << consumer
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