Sha256: cede93bf3d38fc678ddb3343867c3e423b1a0c0b6f2c4e50ea974ec67813154e

Contents?: true

Size: 906 Bytes

Versions: 17

Compression:

Stored size: 906 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

17 entries across 17 versions & 1 rubygems

Version Path
ntail-1.3.1 test/ntail/test_uri.rb
ntail-1.3.0 test/ntail/test_uri.rb
ntail-1.2.0 test/ntail/test_uri.rb
ntail-1.1.4 test/ntail/test_uri.rb
ntail-1.1.3 test/ntail/test_uri.rb
ntail-1.1.2 test/ntail/test_uri.rb
ntail-1.1.1 test/ntail/test_uri.rb
ntail-1.1.0 test/ntail/test_uri.rb
ntail-1.0.2 test/ntail/test_uri.rb
ntail-1.0.0 test/ntail/test_uri.rb
ntail-0.2.0 test/ntail/test_uri.rb
ntail-0.1.0 test/ntail/test_uri.rb
ntail-0.0.12 test/ntail/test_uri.rb
ntail-0.0.11 test/ntail/test_uri.rb
ntail-0.0.10 test/ntail/test_uri.rb
ntail-0.0.9 test/ntail/test_uri.rb
ntail-0.0.8 test/ntail/test_uri.rb