Commit fa609480 authored by Fabio Pelosin's avatar Fabio Pelosin

[SandboxAnalyzer] mark as changed Pods whose head state doesn't mathc

Closes #1160
parent a9d87406
......@@ -150,6 +150,7 @@ module Pod
return true if resolved_spec_names(pod) != sandbox_spec_names(pod)
return true if sandbox.predownloaded?(pod)
return true if folder_empty?(pod)
return true if sandbox.head_pod?(pod) != sandbox_head_verision?(pod)
if update_mode
return true if sandbox.head_pod?(pod)
end
......@@ -235,6 +236,13 @@ module Pod
sandbox_manifest.checksum(pod)
end
# @return [Bool] Wether the Pod is installed in the sandbox is in head
# mode.
#
def sandbox_head_verision?(pod)
sandbox_version(pod).head? == true
end
#--------------------------------------#
def folder_exist?(pod)
......
......@@ -88,6 +88,11 @@ module Pod
@analyzer.send(:pod_changed?, 'BananaLib').should == true
end
it "considers changed a Pod whose head state doesn't match" do
@sandbox.stubs(:head_pod?).returns(true)
@analyzer.send(:pod_changed?, 'BananaLib').should == true
end
it "considers changed a Pod whose specification is in head mode if in update mode" do
@sandbox.stubs(:head_pod?).returns(true)
@analyzer.stubs(:update_mode).returns(true)
......@@ -96,6 +101,7 @@ module Pod
it "doesn't consider changed a Pod whose specification is in head mode if not in update mode" do
@sandbox.stubs(:head_pod?).returns(true)
@analyzer.stubs(:sandbox_head_verision?).returns(true)
@analyzer.stubs(:update_mode).returns(false)
@analyzer.send(:pod_changed?, 'BananaLib').should == false
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