class CLIntegracon::Configuration
Private Class Methods
adapters()
click to toggle source
Get the file paths of supported adapter implementations by test framework
@return [Hash<Symbol, String>]
test framework to adapter implementation files
# File lib/CLIntegracon/configuration.rb, line 79 def self.adapters adapter_dir = Pathname('../adapter').expand_path(__FILE__) @adapters ||= Dir.chdir(adapter_dir) do Hash[Dir['*.rb'].map { |path| [path.gsub(/\.rb$/, '').to_sym, adapter_dir + path] }] end end
Public Instance Methods
file_tree_spec_context()
click to toggle source
Get the context to configure it
@return [FileTreeSpecContext]
# File lib/CLIntegracon/configuration.rb, line 37 def file_tree_spec_context @file_tree_spec_context ||= FileTreeSpecContext.new() end
hook_into(test_framework)
click to toggle source
Hook this gem in a test framework by a supported adapter
@param [Symbol] test_framework
the test framework
# 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
method_missing(method, *args, &block)
click to toggle source
Delegate missing methods to file_tree_spec_context
Calls superclass method
# 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
respond_to?(method)
click to toggle source
Take care of delegation to file_tree_spec_context
Calls superclass method
# File lib/CLIntegracon/configuration.rb, line 53 def respond_to?(method) if file_tree_spec_context.respond_to?(method) true else super end end
subject()
click to toggle source
Get the subject to configure it
@return [Subject]
# File lib/CLIntegracon/configuration.rb, line 29 def subject @subject ||= Subject.new() end