Commit a5b8aca1 authored by Eloy Durán's avatar Eloy Durán

[Analizer] Fix needs_install?

parent 371f7bae
......@@ -65,21 +65,22 @@ module Pod
# CocoaPods project is already up to date.
#
def needs_install?
podfile_needs_install? || sandbox_needs_install?
analysis_result = analyze(false)
podfile_needs_install?(analysis_result) || sandbox_needs_install?(analysis_result)
end
# @return [Bool] Whether the podfile has changes respect to the lockfile.
#
def podfile_needs_install?
state = generate_podfile_state
def podfile_needs_install?(analysis_result)
state = analysis_result.podfile_state
needing_install = state.added + state.changed + state.deleted
!needing_install.empty?
end
# @return [Bool] Whether the sandbox is in synch with the lockfile.
#
def sandbox_needs_install?
state = generate_sandbox_state
def sandbox_needs_install?(analysis_result)
state = analysis_result.sandbox_state
needing_install = state.added + state.changed + state.deleted
!needing_install.empty?
end
......
......@@ -39,11 +39,13 @@ module Pod
end
it "returns whether the Podfile has changes" do
@analyzer.podfile_needs_install?.should.be.true
analysis_result = @analyzer.analyze(false)
@analyzer.podfile_needs_install?(analysis_result).should.be.true
end
it "returns whether the sandbox is not in sync with the lockfile" do
@analyzer.sandbox_needs_install?.should.be.true
analysis_result = @analyzer.analyze(false)
@analyzer.sandbox_needs_install?(analysis_result).should.be.true
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