Sha256: b23ff799d3260bf85de0618baf27d4abe72d87a9b8e736fab6f1747b6390090d

Contents?: true

Size: 729 Bytes

Versions: 11

Compression:

Stored size: 729 Bytes

Contents

module RequestLogAnalyzer::Spec::Helper
  
  include RequestLogAnalyzer::Spec::Mocks


  def testing_format
    @testing_format ||= TestingFormat.new
  end
  
  def log_fixture(name)
    File.dirname(__FILE__) + "/../fixtures/#{name}.log"
  end

  def request(fields, format = testing_format)
    if fields.kind_of?(Array)
      format.request(*fields)
    else
      format.request(fields)      
    end
  end

  def run(arguments)
    binary = "#{File.dirname(__FILE__)}/../../bin/request-log-analyzer"
    arguments = arguments.join(' ') if arguments.kind_of?(Array)
    
    output = []
    IO.popen("#{binary} #{arguments}") do |pipe|
      output = pipe.readlines
    end
    $?.exitstatus.should == 0
    output
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.1.3 spec/lib/helper.rb
wvanbergen-request-log-analyzer-1.1.4 spec/lib/helper.rb
wvanbergen-request-log-analyzer-1.1.5.1 spec/lib/helper.rb
wvanbergen-request-log-analyzer-1.1.6 spec/lib/helper.rb
wvanbergen-request-log-analyzer-1.1.7 spec/lib/helper.rb
wvanbergen-request-log-analyzer-1.2.0 spec/lib/helper.rb
request-log-analyzer-1.1.3 spec/lib/helper.rb
request-log-analyzer-1.2.0 spec/lib/helper.rb
request-log-analyzer-1.1.6 spec/lib/helper.rb
request-log-analyzer-1.1.5.1 spec/lib/helper.rb
request-log-analyzer-1.1.4 spec/lib/helper.rb