Module: NanDoc::SpecDoc

Defined in:
lib/nandoc/spec-doc.rb,
lib/nandoc/spec-doc/recordings.rb,
lib/nandoc/spec-doc/parse-trace.rb,
lib/nandoc/spec-doc/code-snippet.rb,
lib/nandoc/spec-doc/generic-agent.rb,
lib/nandoc/spec-doc/test-case-agent.rb,
lib/nandoc/spec-doc/ruby2ruby-standin.rb,
lib/nandoc/spec-doc/agent-instance-methods.rb,
lib/nandoc/spec-doc/playback/terminal/color-to-html.rb

Defined Under Namespace

Modules: AgentInstanceMethods, GenericInstanceMethods, ParseTrace, Playback, Ruby2RubyStandin, SpecInstanceMethods, TestFramework Classes: CodeSnippet, GenericAgent, Recordings, TestCaseAgent

Class Method Summary collapse

Class Method Details

.include_to(mod) ⇒ Object Also known as: included

enhance a test framework spec or test case module for e.g. a minitest spec class.



26
27
28
29
30
31
32
33
34
# File 'lib/nandoc/spec-doc.rb', line 26

def include_to mod
  if Object.const_defined?('MiniTest') &&
      mod.ancestors.include?(::MiniTest::Spec)
    require 'nandoc/extlib/minitest.rb'
    SpecInstanceMethods.include_to mod
  else
    GenericInstanceMethods.include_to mod
  end
end