Class: Dichotomy::Extensions::TestExtension

Inherits:
Base::Extension::ContainerExtension show all
Defined in:
lib/dichotomy/extensions/test_extension.rb

Instance Method Summary collapse

Methods inherited from Base::Extension::ContainerExtension

#initialize_extension, #update

Instance Method Details

#initialize_contextObject



7
8
9
# File 'lib/dichotomy/extensions/test_extension.rb', line 7

def initialize_context

end

#observed_notifications(symbol, type) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dichotomy/extensions/test_extension.rb', line 15

def observed_notifications(symbol, type)
  # catches the event from DefaultStrategy
  if symbol === :register_type
    on_register_type(type)
  end

  #remove me after test
  if symbol === :resolve_type
    on_register_type(type)
  end

  if symbol === :new_build_up
    on_register_type(type)
  end
end

#on_register_type(type) ⇒ Object



11
12
13
# File 'lib/dichotomy/extensions/test_extension.rb', line 11

def on_register_type(type)
  @context.build_manager.strategies.add(Tests::Strategies::TestSubjectStrategy.new, 1)
end