Class Index [+]

Quicksearch

ActiveSupport::Testing::Declarative

Public Class Methods

describe(text) click to toggle source
    # File lib/active_support/testing/declarative.rb, line 9
 9:             def self.describe(text)
10:               class_eval                 def self.name                  "#{text}"                end, __FILE__, __LINE__ + 1
11:             end
extended(klass) click to toggle source
    # File lib/active_support/testing/declarative.rb, line 5
 5:       def self.extended(klass)
 6:         klass.class_eval do
 7: 
 8:           unless method_defined?(:describe)
 9:             def self.describe(text)
10:               class_eval                 def self.name                  "#{text}"                end, __FILE__, __LINE__ + 1
11:             end
12:           end
13: 
14:         end
15:       end

Public Instance Methods

test(name, &block) click to toggle source

test “verify something” do

  ...

end

    # File lib/active_support/testing/declarative.rb, line 25
25:         def test(name, &block)
26:           test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
27:           defined = instance_method(test_name) rescue false
28:           raise "#{test_name} is already defined in #{self}" if defined
29:           if block_given?
30:             define_method(test_name, &block)
31:           else
32:             define_method(test_name) do
33:               flunk "No implementation provided for #{name}"
34:             end
35:           end
36:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.