File: test_unit.rb

package info (click to toggle)
ruby-rr 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,424 kB
  • sloc: ruby: 11,405; makefile: 7
file content (21 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module TestCase
  module TestUnit
    attr_accessor :superclass

    def include_adapter_tests
      add_to_before_tests <<-EOT
        include AdapterTests::TestUnit
      EOT
    end

    private

    def start_of_test_case
      "class FooTest < #{superclass}"
    end

    def build_test(index, body)
      ["def test_#{index}", body, "end"].map { |line| line + "\n" }.join
    end
  end
end