Commit 6cedabcb authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #2601 from CocoaPods/unnecessary-save

[TargetIntegrator] Ensures that the user project is not saved when there are no user targets integrated.
parents 72502e22 0b57e066
......@@ -49,6 +49,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Samuel Giddins](https://github.com/segiddins)
[#3586](https://github.com/CocoaPods/CocoaPods/issues/2586)
* Ensures that the user project is not saved when there are no
user targets integrated.
[Samuel Giddins](https://github.com/segiddins)
[#2561](https://github.com/CocoaPods/CocoaPods/issues/2561)
[#2593](https://github.com/CocoaPods/CocoaPods/issues/2593)
## 0.34.1
......
......@@ -77,7 +77,7 @@ module Pod
DESC
def run
sets = SourcesManager.all_sets
sets = SourcesManager.aggregate.all_sets
result = {}
sets.each do |set|
begin
......
......@@ -40,6 +40,8 @@ module Pod
#
attr_reader :update_mode
alias_method :update_mode?, :update_mode
# @return [Lockfile] The lockfile of the installation as a fall-back if
# there is no sandbox manifest. This is indented as a temporary
# solution to prevent the full re-installation from users which
......
......@@ -34,8 +34,8 @@ module Pod
add_pods_library
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
user_project.save
end
user_project.save
end
end
......
......@@ -42,9 +42,9 @@ module Pod
it 'prints a list of podspecs in the yaml format and prints it to STDOUT' do
spec = fixture_spec('banana-lib/BananaLib.podspec')
set = Specification.new('BananaLib')
set = Specification::Set.new('BananaLib', [])
set.stubs(:specification).returns(spec)
SourcesManager.stubs(:all_sets).returns([set])
Source.any_instance.stubs(:pod_sets).returns([set])
out = run_command('ipc', 'list')
out.should.include('---')
......
......@@ -7,7 +7,7 @@ module Pod
before do
@test_source = Source.new(fixture('spec-repos/test_repo'))
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
SourcesManager.updated_search_index = nil
end
......
......@@ -92,6 +92,8 @@ module Bacon
end
end
Mocha::Configuration.prevent(:stubbing_non_existent_method)
module SpecHelper
def self.temporary_directory
ROOT + 'tmp'
......
......@@ -97,7 +97,7 @@ module Pod
@target_integrator.stubs(:native_targets_to_integrate).returns([])
@target_integrator.expects(:add_pods_library).never
@target_integrator.expects(:add_copy_resources_script_phase).never
@target_integrator.expects(:save_user_project).never
@target_integrator.send(:user_project).expects(:save).never
@target_integrator.integrate!
end
end
......
......@@ -136,7 +136,7 @@ module Pod
workspace = Xcodeproj::Workspace.new(file_references)
workspace_path = @integrator.send(:workspace_path)
workspace.save_as(workspace_path)
Xcodeproj::Workspace.expects(:save_as).never
Xcodeproj::Workspace.any_instance.expects(:save_as).never
@integrator.send(:create_workspace)
end
......
......@@ -74,7 +74,6 @@ module Pod
@installer.stubs(:run_pre_install_hooks)
@installer.stubs(:install_file_references)
@installer.stubs(:install_libraries)
@installer.stubs(:link_aggregate_target)
@installer.stubs(:write_lockfiles)
@installer.stubs(:aggregate_targets).returns([])
@installer.unstub(:generate_pods_project)
......
......@@ -38,13 +38,13 @@ module Pod
describe 'In general' do
before do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
end
#--------------------------------------#
it 'returns all the sources' do
Source::Aggregate.any_instance.unstub(:all)
SourcesManager.unstub(:all)
SourcesManager.all.map(&:name).should == %w(master test_repo)
end
......@@ -66,21 +66,21 @@ module Pod
end
it 'can perform a full text search of the sets' do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
sets = SourcesManager.search_by_name('Chunky', true)
sets.all? { |s| s.class == Specification::Set }.should.be.true
sets.any? { |s| s.name == 'BananaLib' }.should.be.true
end
it 'can perform a full text regexp search of the sets' do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
sets = SourcesManager.search_by_name('Ch[aeiou]nky', true)
sets.all? { |s| s.class == Specification::Set }.should.be.true
sets.any? { |s| s.name == 'BananaLib' }.should.be.true
end
it "generates the search index before performing a search if it doesn't exits" do
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
Source::Aggregate.any_instance.expects(:generate_search_index).returns('BananaLib' => {})
Source::Aggregate.any_instance.expects(:update_search_index).never
SourcesManager.updated_search_index = nil
......@@ -89,7 +89,7 @@ module Pod
it 'updates the search index before performing a search if it exits' do
File.open(SourcesManager.search_index_path, 'w') { |file| file.write("---\nBananaLib:\n version: 0.0.1") }
Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
SourcesManager.stubs(:all).returns([@test_source])
Source::Aggregate.any_instance.expects(:generate_search_index).never
Source::Aggregate.any_instance.expects(:update_search_index).returns('BananaLib' => {})
SourcesManager.updated_search_index = nil
......
......@@ -202,7 +202,7 @@ module Pod
end
it 'checks if the social media URL is valid' do
Specification.any_instance.stubs(:social_media_urlon_url).returns('http://banana-corp.local/')
Specification.any_instance.stubs(:social_media_url).returns('http://banana-corp.local/')
WebMock::API.stub_request(:head, /banana-corp.local/).to_return(:status => 200)
@sut.validate
@sut.results.should.be.empty?
......
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