Sha256: ffaf320b72b54f9e58b6bda51555a619c817bd0d858a9a4e20ecee6b3978ba4e

Contents?: true

Size: 1.22 KB

Versions: 27

Compression:

Stored size: 1.22 KB

Contents

require_relative '../spec_helper.rb'

class <%= options[:spec_class_name] %>
  extend AssessmentHelpers
  def self.default_test_config
    {  }
  end 
end

describe <%= options[:spec_class_name] %>, scan_assessment: true do
  context 'for all targets' do
    it 'should report results' do
      expect(@vulnerable_results.size).to be > 0
      expect(@secure_results.size).to be > 0
    end
  end

  context 'for vulnerable machine' do
    before :each do
      @result = @vulnerable_results.first
    end

    it 'should report a failure' do
      expect(@result['status']).to eq('fail')
    end
  end

  context 'for secure machine' do
    before :each do
      @result = @secure_results.first
    end

    it 'should report a passing result' do
      expect(@result['status']).to eq('pass')
    end

    it 'should set the sir rating to no impact' do
      expect(@result['sir']).to eq('no_impact')
    end
  end

  context 'for machine with all ports closed' do
    before :each do
      @result = @base_results.first
    end

    it 'should report a passing result' do
      expect(@result['status']).to eq('pass')
    end

    it 'should set the sir rating to no impact' do
      expect(@result['sir']).to eq('no_impact')
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
norad_cli-0.1.10 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.9 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.8 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.6 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.5 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.4 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.3 lib/norad_cli/templates/tool/tool_spec.rb.erb