Parent

Methods

Test::Unit::TestCase

@ see gist.github.com/316780 Used to fix a minor minitest/unit incompatibility in flexmock AssertionFailedError = Class.new(StandardError)


@see push.cx/2007/fixtures-in-ruby-unit-tests

Public Class Methods

fixtures(*args) click to toggle source
    # File test/test_helper.rb, line 33
33:         def self.fixtures *args
34:                 [args].flatten.each do |fixture|
35:                         self.class_eval do
36:                                 # add a method name for this fixture type
37:                                 define_method(fixture) do |item|
38:                                         # load and cache the YAML
39:                                         @@fixtures[fixture] ||= YAML::load_file("./fixtures/#{fixture.to_s}.yml")
40:                                         @@fixtures[fixture][item.to_s]
41:                                 end
42:                         end
43:                 end
44:         end
must(name, &block) click to toggle source
    # File test/test_helper.rb, line 14
14:                 def self.must(name, &block)
15:                         test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
16:                         defined = instance_method(test_name) rescue false
17:                         raise "#{test_name} is already defined in #{self}" if defined
18:                         if block_given?
19:                                 define_method(test_name, &block)
20:                         else
21:                                 define_method(test_name) do
22:                                         flunk "No implementation provided for #{name}"
23:                                 end
24:                         end
25:                 end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.