Commit a738212b authored by Marius Rackwitz's avatar Marius Rackwitz

[Spec] Adapt changes by using more spec helpers

parent d4595215
...@@ -7,14 +7,11 @@ module Pod ...@@ -7,14 +7,11 @@ module Pod
describe 'in general' do describe 'in general' do
before do before do
@spec = fixture_spec('banana-lib/BananaLib.podspec') @spec = fixture_spec('banana-lib/BananaLib.podspec')
@consumer = @spec.consumer(:ios) @pod_target = fixture_pod_target(@spec)
target_definition = Podfile::TargetDefinition.new('Pods', nil) @consumer = @pod_target.spec_consumers.first
@pod_target = PodTarget.new([@spec], [target_definition], config.sandbox) @podfile = @pod_target.podfile
@pod_target.stubs(:platform).returns(:ios)
public_xcconfig = Xcodeproj::Config.new('OTHER_LDFLAGS' => '-framework SystemConfiguration') public_xcconfig = Xcodeproj::Config.new('OTHER_LDFLAGS' => '-framework SystemConfiguration')
@generator = PrivatePodXCConfig.new(@pod_target, public_xcconfig) @generator = PrivatePodXCConfig.new(@pod_target, public_xcconfig)
@podfile = Podfile.new
@pod_target.target_definition.stubs(:podfile).returns(@podfile)
@xcconfig = @generator.generate @xcconfig = @generator.generate
end end
......
...@@ -6,23 +6,16 @@ module Pod ...@@ -6,23 +6,16 @@ module Pod
describe PublicPodXCConfig do describe PublicPodXCConfig do
before do before do
@spec = fixture_spec('banana-lib/BananaLib.podspec') @spec = fixture_spec('banana-lib/BananaLib.podspec')
@target_definition = Podfile::TargetDefinition.new('Pods', nil) @pod_target = fixture_pod_target(@spec)
@pod_target = PodTarget.new([@spec], [@target_definition], config.sandbox)
@pod_target.stubs(:platform).returns(:ios)
@generator = PublicPodXCConfig.new(@pod_target) @generator = PublicPodXCConfig.new(@pod_target)
@podfile = Podfile.new
@spec.xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' } @spec.xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' }
@spec.frameworks = ['QuartzCore'] @spec.frameworks = ['QuartzCore']
@spec.weak_frameworks = ['iAd'] @spec.weak_frameworks = ['iAd']
@spec.libraries = ['xml2'] @spec.libraries = ['xml2']
file_accessors = [Sandbox::FileAccessor.new(fixture('banana-lib'), @spec.consumer(:ios))]
# vendored_framework_paths = [config.sandbox.root + 'BananaLib/BananaLib.framework'] # vendored_framework_paths = [config.sandbox.root + 'BananaLib/BananaLib.framework']
# Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).returns(vendored_framework_paths) # Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).returns(vendored_framework_paths)
@pod_target.target_definition.stubs(:podfile).returns(@podfile)
@pod_target.stubs(:file_accessors).returns(file_accessors)
@xcconfig = @generator.generate @xcconfig = @generator.generate
end end
......
...@@ -3,10 +3,8 @@ require File.expand_path('../../../spec_helper', __FILE__) ...@@ -3,10 +3,8 @@ require File.expand_path('../../../spec_helper', __FILE__)
module Pod module Pod
describe Installer::FileReferencesInstaller do describe Installer::FileReferencesInstaller do
before do before do
@file_accessor = fixture_file_accessor('banana-lib/BananaLib.podspec') @pod_target = fixture_pod_target('banana-lib/BananaLib.podspec')
@pod_target = PodTarget.new([], nil, config.sandbox) @file_accessor = @pod_target.file_accessors.first
@pod_target.stubs(:platform).returns(Platform.new(:ios, '6.0'))
@pod_target.file_accessors = [@file_accessor]
@project = Project.new(config.sandbox.project_path) @project = Project.new(config.sandbox.project_path)
@project.add_pod_group('BananaLib', fixture('banana-lib')) @project.add_pod_group('BananaLib', fixture('banana-lib'))
@installer = Installer::FileReferencesInstaller.new(config.sandbox, [@pod_target], @project) @installer = Installer::FileReferencesInstaller.new(config.sandbox, [@pod_target], @project)
......
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