Sha256: 98a2dbb9b4258d7a8b4fe6b5196e49720e317a1f688e0bc82ab60d40585ef3e8

Contents?: true

Size: 805 Bytes

Versions: 33

Compression:

Stored size: 805 Bytes

Contents

class Relevance::Tarantula::IOReporter
  
  include Relevance::Tarantula
  attr_accessor :io, :results
  delegate :successes, :failures, :to => :results
  
  IOResultOverview = Struct.new(:code, :url)
  
  def initialize(io)
    @io = io
    @results = Struct.new(:successes, :failures).new([], [])
  end
  
  def report(result)
    return if result.nil?
    
    unless result.success # collection = result.success ? results.successes : results.failures
      results.failures << IOResultOverview.new(
        result.code, result.url
      )
    end
  end
  
  def finish_report(test_name)
    unless (failures).empty?
      io.puts "****** FAILURES"
      failures.each do |failure|
        io.puts "#{failure.code}: #{failure.url}"
      end
      raise "#{failures.size} failures"
    end
  end
  
end

Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
relevance-tarantula-0.0.1 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.2 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.3 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.5 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.6 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.7.1 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.7 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.8.0 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.0.8.1 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.0 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.1 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.2 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.3 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.4 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.5 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.6 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.7 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.1.8 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.2.0 lib/relevance/tarantula/io_reporter.rb
relevance-tarantula-0.2.1 lib/relevance/tarantula/io_reporter.rb