Sha256: df308b90c24bfbaef987a5c1dda28920d23aeaf062b5e9be9068673bbda0011c

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

require 'minitest/autorun'
require './lib/yawast'
require './test/base'

class TestScannerIisHeaders < Minitest::Test
  include TestBase

  def test_iis_basic_banner
    server = 'Microsoft-IIS/8.5'

    override_stdout
    Yawast::Scanner::Iis.check_banner server

    assert stdout_value.include?("IIS Version: #{server}"), "Unexpected banner: #{stdout_value}"

    restore_stdout
  end

  def test_asp_version
    headers = parse_headers_from_file 'test/data/iis_server_header.txt'

    override_stdout
    Yawast::Scanner::Iis.check_asp_banner headers

    assert stdout_value.include?('ASP.NET Version'), 'ASP.NET Version warning not found.'

    restore_stdout
  end

  def test_mvc_version
    headers = parse_headers_from_file 'test/data/iis_server_header.txt'

    override_stdout
    Yawast::Scanner::Iis.check_mvc_version headers

    assert stdout_value.include?('ASP.NET MVC Version'), 'ASP.NET MVC Version warning not found.'

    restore_stdout
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yawast-0.2.0.beta2 test/test_scan_iis_headers.rb
yawast-0.2.0.beta1 test/test_scan_iis_headers.rb