File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,11 +276,6 @@ def perform(mode, params = {})
276276 end
277277 end
278278
279- check_unused_params ( actions , params )
280-
281- # Print name of actions to be performed for debug purposes
282- print_action_names ( mode , actions )
283-
284279 # TODO: Check all action params first
285280
286281 new_params = params
@@ -299,9 +294,12 @@ def perform(mode, params = {})
299294
300295 skip_actions = ( params . skip_actions || [ ] )
301296 actions = actions . reject do |action |
302- skip_actions . include? ( action . to_s )
297+ skip_actions . include? ( action . name . split ( '::' ) . last )
303298 end
304299
300+ check_unused_params ( actions , params )
301+ print_action_names ( mode , actions )
302+
305303 # Run actions
306304 errors = [ ]
307305 results = [ ]
Original file line number Diff line number Diff line change 1+ # encoding: UTF-8
2+ #
3+ # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
4+ # This source code is licensed under the BSD-style license found in the
5+ # LICENSE file in the root directory of this source tree.
6+
7+ require 'gooddata/lcm/lcm2'
8+
9+ describe 'GoodData::LCM2' do
10+ describe '#skip_actions' do
11+ let ( :client ) { double ( :client ) }
12+ let ( :domain ) { double ( :domain ) }
13+ let ( :logger ) { double ( :logger ) }
14+ let ( :params ) do
15+ params = {
16+ skip_actions : %w( CollectSegments SynchronizeUsers ) ,
17+ GDC_GD_CLIENT : client ,
18+ GDC_LOGGER : logger
19+ }
20+ GoodData ::LCM2 . convert_to_smart_hash ( params )
21+ end
22+
23+ before do
24+ allow ( client ) . to receive ( :class ) { GoodData ::Rest ::Client }
25+ allow ( client ) . to receive ( :domain ) { domain }
26+ allow ( logger ) . to receive ( :info )
27+ allow ( domain ) . to receive ( :data_products )
28+ end
29+
30+ it 'skips actions in skip_actions' do
31+ expect ( GoodData ::LCM2 ::CollectSegments ) . not_to receive ( :call )
32+ expect ( GoodData ::LCM2 ::SynchronizeUsers ) . not_to receive ( :call )
33+ GoodData ::LCM2 . perform ( 'users' , params )
34+ end
35+ end
36+ end
You can’t perform that action at this time.
0 commit comments