Sha256: fb79df295c08c7802dbaece1a49aada394b27d2e7fe14ecd1ed82a34a9820f9a

Contents?: true

Size: 1.23 KB

Versions: 13

Compression:

Stored size: 1.23 KB

Contents

require 'helper'

class TestHttpVersion < Test::Unit::TestCase

  context "ntail" do
    
    should "correctly identify the HTTP version of the request" do
      http_version = "HTTP/1.0"
      # directly via the helper function
      assert_equal http_version, NginxTail::LogLine.to_http_version_s(http_version)
      # parsed from a raw log line
      log_line = random_log_line(:http_version => http_version)
      assert_equal http_version, log_line.to_http_version_s
    end

    should "correctly identify the major HTTP version" do
      http_version = "HTTP/1.0"
      # directly via the helper function
      assert_equal "1", NginxTail::LogLine.to_http_version_s(http_version, :major)
      # parsed from a raw log line
      log_line = random_log_line(:http_version => http_version)
      assert_equal "1", log_line.to_http_version_s(:major)
    end

    should "correctly identify the minor HTTP version" do
      http_version = "HTTP/1.0"
      # directly via the helper function
      assert_equal "1", NginxTail::LogLine.to_http_version_s(http_version, :minor)
      # parsed from a raw log line
      log_line = random_log_line(:http_version => http_version)
      assert_equal "1", log_line.to_http_version_s(:minor)
    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ntail-1.3.1 test/ntail/test_http_version.rb
ntail-1.3.0 test/ntail/test_http_version.rb
ntail-1.2.0 test/ntail/test_http_version.rb
ntail-1.1.4 test/ntail/test_http_version.rb
ntail-1.1.3 test/ntail/test_http_version.rb
ntail-1.1.2 test/ntail/test_http_version.rb
ntail-1.1.1 test/ntail/test_http_version.rb
ntail-1.1.0 test/ntail/test_http_version.rb
ntail-1.0.2 test/ntail/test_http_version.rb
ntail-1.0.0 test/ntail/test_http_version.rb
ntail-0.2.0 test/ntail/test_http_version.rb
ntail-0.1.0 test/ntail/test_http_version.rb
ntail-0.0.12 test/ntail/test_http_version.rb