Sha256: 5e3ed5e5905888c9c195ac921d41c68a95d4d9a5a507b39db25c8eb99f8eb3d6

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module SelfTestingFramework
  class Runner

    def initialize(classes)
      @classes = classes
    end

    def execute
      reporter = Reporter.new
      test_results = TestResult.new

      @classes.each do |klass|
        klass.new.methods.grep(/test_/).each do |test_method|
          begin
            klass.run test_method
            test_results.passed(klass.name, test_method)
          rescue SelfTestingFramework::AssertFalse => e
            test_results.errored(klass.name, test_method, e.message)
          end
          reporter.report test_results.last_test
        end
      end
      reporter.total_report test_results
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
self_testing_framework-0.0.1 lib/self_testing_framework/runner.rb