Sha256: 388c5fdec85280a6d8fb8c567f3d046fadee7409c6a087073cb5e7dc9c31d146

Contents?: true

Size: 882 Bytes

Versions: 1

Compression:

Stored size: 882 Bytes

Contents

require 'helper'

class TestUri < Test::Unit::TestCase

  context "ntail" do

    teardown do
      # undo any changes the test may have made
      NginxTail::LogLine.reset_automatic_files
    end

    should "correctly identify a default automatic request" do
      # directly via the helper function
      # parsed from a raw log line
      log_line = random_log_line(:uri => '/index.html')
      assert !log_line.automatic_uri?
      log_line = random_log_line(:uri => '/robots.txt')
      assert log_line.automatic_uri?
    end

    should "correctly identify a custom automatic request" do
      # directly via the helper function
      # parsed from a raw log line
      log_line = random_log_line(:uri => '/blegga.html')
      assert !log_line.automatic_uri?
      NginxTail::LogLine.add_automatic_file('blegga.html')
      assert log_line.automatic_uri?
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ntail-1.3.2 test/ntail/test_uri.rb