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.2.5 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.2.4 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.2.3 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.2.2 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.2.1 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.2.0 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.24 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.23 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.22 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.21 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.20 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.19 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.18 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.17 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.16 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.15 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.14 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.13 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.12 lib/norad_cli/templates/tool/tool_spec.rb.erb
norad_cli-0.1.11 lib/norad_cli/templates/tool/tool_spec.rb.erb