Class: CLIntegracon::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/CLIntegracon/configuration.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Delegate missing methods to #file_tree_spec_context


43
44
45
46
47
48
49
# File 'lib/CLIntegracon/configuration.rb', line 43

def method_missing(method, *args, &block)
  if file_tree_spec_context.respond_to?(method)
    file_tree_spec_context.send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#file_tree_spec_contextFileTreeSpecContext

Get the context to configure it

Returns:


37
38
39
# File 'lib/CLIntegracon/configuration.rb', line 37

def file_tree_spec_context
  @file_tree_spec_context ||= FileTreeSpecContext.new()
end

#hook_into(test_framework) ⇒ Object

Hook this gem in a test framework by a supported adapter

Parameters:

  • test_framework (Symbol)

    the test framework


66
67
68
69
70
# File 'lib/CLIntegracon/configuration.rb', line 66

def hook_into test_framework
  adapter = self.class.adapters[test_framework]
  raise ArgumentError.new "No adapter for test framework #{test_framework}" if adapter.nil?
  require adapter
end

#respond_to?(method) ⇒ Boolean

Take care of delegation to #file_tree_spec_context

Returns:

  • (Boolean)

53
54
55
56
57
58
59
# File 'lib/CLIntegracon/configuration.rb', line 53

def respond_to?(method)
  if file_tree_spec_context.respond_to?(method)
    true
  else
    super
  end
end

#subjectSubject

Get the subject to configure it

Returns:


29
30
31
# File 'lib/CLIntegracon/configuration.rb', line 29

def subject
  @subject ||= Subject.new()
end