Sha256: b8f0a6c7c0c4a67071f38acd34c959280009bb315b8937523040dd94ed352fc8

Contents?: true

Size: 1.05 KB

Versions: 22

Compression:

Stored size: 1.05 KB

Contents

module Turn
  require 'turn/runners/isorunner'

  # = Cross Runner
  #
  # Cross Runner runs test in pairs.
  #
  # TODO: This needs work in the test_loop_runner.
  #       It needs to show the files being cross tested.
  #
  # TODO: Cross runner output needs to be fixed
  class CrossRunner < IsoRunner

    #
    def start
      suite = TestSuite.new

      files = @config.files
      viles = @config.files # TODO: make selectable ?

      #files = files.select{ |f| File.extname(f) == '.rb' and File.file?(f) }
      #viles = viles.select{ |f| File.extname(f) == '.rb' and File.file?(f) }

      pairs = files.inject([]){ |m, f| viles.collect{ |v| m << [f,v] }; m }
      pairs = pairs.reject{ |f,v| f == v }

      max = files.collect{ |f| f.sub(Dir.pwd+'/','').size }.max

      testruns = pairs.collect do |file1, file2|
        name1 = file1.sub(Dir.pwd+'/','')
        name2 = file2.sub(Dir.pwd+'/','')
        name = "%-#{max}s %-#{max}s" % [name1, name2]
        suite.new_case(name, file1, file2)
      end

      test_loop_runner(suite)
    end

  end

end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
turn-0.9.7 lib/turn/runners/crossrunner.rb
challah-1.0.0 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
swipe-rails-0.0.5 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-1.0.0.beta3 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-1.0.0.beta2 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-1.0.0.beta vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-0.9.1.beta.3 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-0.9.1.beta vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-0.9.0 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
challah-0.8.3 vendor/bundle/gems/turn-0.9.6/lib/turn/runners/crossrunner.rb
turn-0.9.6 lib/turn/runners/crossrunner.rb
challah-0.6.1 vendor/bundle/gems/turn-0.9.5/lib/turn/runners/crossrunner.rb
challah-0.6.0 vendor/bundle/gems/turn-0.9.5/lib/turn/runners/crossrunner.rb
turn-0.9.5 lib/turn/runners/crossrunner.rb
turn-0.9.4 lib/turn/runners/crossrunner.rb
turn-0.9.3 lib/turn/runners/crossrunner.rb
turn-0.9.2 lib/turn/runners/crossrunner.rb
turn-0.9.1 lib/turn/runners/crossrunner.rb