Sha256: c852305ac1dbcba944da4927ec8cb8f28564267079d71d5eb8cd77cdd42e28d0

Contents?: true

Size: 880 Bytes

Versions: 5

Compression:

Stored size: 880 Bytes

Contents

require 'spec_helper'

shared_examples CMSScanner::Target::Server::Generic do

  describe '#server' do
    before { stub_request(:head, target.url).to_return(headers: parse_headers_file(fixture)) }

    context 'when apache headers' do
      %w(basic.txt).each do |file|
        context "when #{file} headers" do
          let(:fixture) { File.join(fixtures, 'server', 'apache', file) }

          its(:server) { should eq :Apache }
        end
      end
    end

    context 'when iis headers' do
      %w(basic.txt).each do |file|
        context "when #{file} headers" do
          let(:fixture) { File.join(fixtures, 'server', 'iis', file) }

          its(:server) { should eq :IIS }
        end
      end
    end

    context 'not detected' do
      let(:fixture) { File.join(fixtures, 'server', 'not_detected.txt') }

      its(:server) { should be nil }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cms_scanner-0.0.6 spec/shared_examples/target/server/generic.rb
cms_scanner-0.0.5 spec/shared_examples/target/server/generic.rb
cms_scanner-0.0.4 spec/shared_examples/target/server/generic.rb
cms_scanner-0.0.3 spec/shared_examples/target/server/generic.rb
cms_scanner-0.0.2 spec/shared_examples/target/server/generic.rb