Methods

Kernel

Private Instance Methods

describe(desc, &block) click to toggle source

Describe a series of expectations for a given target desc.

TODO: find good tutorial url.

Defines a test class subclassing from either MiniTest::Unit::TestCase or from the surrounding describe’s class.

    # File lib/minitest/spec.rb, line 69
69:   def describe desc, &block
70:     stack = MiniTest::Spec.describe_stack
71:     name  = desc.to_s.split(/\W+/).map { |s| s.capitalize }.join + "Spec"
72:     prev  = stack.last
73:     name  = "#{prev == MiniTest::Spec ? nil : prev}::#{name}"
74:     cls   = Object.class_eval "class #{name} < #{prev}; end; #{name}"
75: 
76:     cls.nuke_test_methods!
77: 
78:     stack.push cls
79:     cls.class_eval(&block)
80:     stack.pop
81:     cls
82:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.