Sha256: 5b423deba93747558e83f28f4c7498691d915d0b22302a0062d4bf1644e124f6

Contents?: true

Size: 1.57 KB

Versions: 27

Compression:

Stored size: 1.57 KB

Contents

require 'spec_helper'

describe RequestLogAnalyzer::FileFormat do

  describe '.autodetect' do
    it "should autodetect a Merb log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:merb))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::Merb)
    end

    it "should autodetect a MySQL slow query log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:mysql_slow_query))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::Mysql)
    end

    it "should autodetect a Rails 1.x log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:rails_1x))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::Rails)
    end

    it "should autodetect a Rails 2.x log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:rails_22))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::RailsDevelopment)
    end

    it "should autodetect an Apache access log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:apache_common))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::Apache)
    end

    it "should autodetect a Rack access log" do
      file_format = RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:sinatra))
      file_format.should be_instance_of(RequestLogAnalyzer::FileFormat::Rack)
    end

    it "should not find any file format with a bogus file" do
      RequestLogAnalyzer::FileFormat.autodetect(log_fixture(:test_order)).should be_nil
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
request-log-analyzer-1.13.1 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.13.0 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.11 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.10 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.9 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.8 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.7 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.6 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.5 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.4 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.3 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.2 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.1 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.12.0 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.11.1 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.11.0 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.10.1 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.10.0 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.9.10 spec/unit/file_format/format_autodetection_spec.rb
request-log-analyzer-1.9.9 spec/unit/file_format/format_autodetection_spec.rb