Commit c1cbd9b8 authored by Samuel Giddins's avatar Samuel Giddins

[SpecState] Fix initializing with a hash from a Lockfile

parent 0e98d37d
...@@ -10,8 +10,6 @@ module Pod ...@@ -10,8 +10,6 @@ module Pod
# subspecs are added instead of the name of the Pods. # subspecs are added instead of the name of the Pods.
# #
class SpecsState class SpecsState
STATES = %i(added removed changed unchanged).freeze
# Initialize a new instance # Initialize a new instance
# #
# @param [Hash{Symbol=>String}] pods_by_state # @param [Hash{Symbol=>String}] pods_by_state
...@@ -25,9 +23,14 @@ module Pod ...@@ -25,9 +23,14 @@ module Pod
@unchanged = [] @unchanged = []
if pods_by_state if pods_by_state
STATES.each do |state| {
:added => :added,
:changed => :changed,
:removed => :deleted,
:unchanged => :unchanged,
}.each do |state, spec_state|
Array(pods_by_state[state]).each do |name| Array(pods_by_state[state]).each do |name|
add_name(name, state) add_name(name, spec_state)
end end
end end
end end
......
...@@ -52,7 +52,7 @@ module Pod ...@@ -52,7 +52,7 @@ module Pod
it 'computes the state of the Podfile respect to the Lockfile' do it 'computes the state of the Podfile respect to the Lockfile' do
state = @analyzer.analyze.podfile_state state = @analyzer.analyze.podfile_state
state.added.should == %w(AFNetworking libextobjc/EXTKeyPathCoding libextobjc/EXTSynthesize) state.added.should == %w(AFNetworking libextobjc libextobjc)
state.changed.should == %w() state.changed.should == %w()
state.unchanged.should == %w(JSONKit SVPullToRefresh) state.unchanged.should == %w(JSONKit SVPullToRefresh)
state.deleted.should == %w(NUI) state.deleted.should == %w(NUI)
......
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