Commit 1f47b8af authored by Ben Asher's avatar Ben Asher

Fix tests. Improve validation xcodebuild command spaced path handling

parent 8a812059
......@@ -718,7 +718,7 @@ module Pod
#
def xcodebuild
require 'fourflusher'
command = %W(clean build -workspace #{validation_dir}/App.xcworkspace -scheme App -configuration Release)
command = ['clean', 'build', '-workspace', File.join(validation_dir, 'App.xcworkspace'), '-scheme', 'App', '-configuration', 'Release']
case consumer.platform_name
when :ios
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
......
......@@ -90,7 +90,9 @@ module Pod
it 'updates source backed by a git repository' do
set_up_test_repo_for_update
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
MasterSource.any_instance.expects(:git!).with(%w(pull --ff-only))
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} pull --ff-only).join(' ')
end
@sources_manager.update(test_repo_path.basename.to_s, true)
end
......@@ -105,8 +107,12 @@ module Pod
set_up_test_repo_for_update
test_repo_path.join('.git', 'shallow').open('w') { |f| f << 'a' * 40 }
@sources_manager.expects(:update_search_index_if_needed_in_background).with({}).returns(nil)
MasterSource.any_instance.expects(:git!).with(%w(fetch --unshallow))
MasterSource.any_instance.expects(:git!).with(%w(pull --ff-only))
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} fetch --unshallow).join(' ')
end
MasterSource.any_instance.expects(:git!).with do |options|
options.join(' ').should.equal %W(-C #{test_repo_path} pull --ff-only).join(' ')
end
@sources_manager.update(test_repo_path.basename.to_s, true)
UI.output.should.match /deep fetch.+`master`.+improve future performance/
......
......@@ -435,7 +435,7 @@ module Pod
Executable.stubs(:capture_command).with('git', ['config', '--get', 'remote.origin.url'], :capture => :out).returns(['https://github.com/CocoaPods/Specs.git'])
Executable.stubs(:which).with(:xcrun)
Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild')
command = %w(clean build -workspace App.xcworkspace -scheme App -configuration Release)
command = ['clean', 'build', '-workspace', File.join(validator.validation_dir, 'App.xcworkspace'), '-scheme', 'App', '-configuration', 'Release']
Executable.expects(:capture_command).with('xcodebuild', command, :capture => :merge).once.returns(['', stub(:success? => true)])
args = %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator) + Fourflusher::SimControl.new.destination('Apple TV 1080p')
Executable.expects(:capture_command).with('xcodebuild', command + args, :capture => :merge).once.returns(['', stub(:success? => true)])
......
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