class Object

Constants

APP_PATH
AssessmentHelpers
CONFIG_SHIM

Public Instance Methods

manifest_configurable_check(manifest) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 61
def manifest_configurable_check(manifest)
  testing_for 'configurability'
  if manifest.values['configurable']
    expect(manifest.values['default_config']).to_not be(nil)
  else
    expect(manifest.values['default_config']).to be(nil)
  end
end
manifest_name_check(manifest) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 35
def manifest_name_check(manifest)
  testing_for 'valid name'
  expect(manifest.values['name']).to_not eq(nil)
  expect(manifest.values['name']).to match(%r{\A[A-Za-z][A-Za-z0-9_-]+\z})
  expect(manifest.values['name']).to match(/#{ENV['sectest_name']}/)
end
manifest_registry_check(manifest) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 49
def manifest_registry_check(manifest)
  testing_for 'existence of registry'
  expect(manifest.values['registry']).to_not eq(nil)
  expect(manifest.values['registry'].is_a?(String)).to eq(true)
end
manifest_test_types_check(manifest) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 55
def manifest_test_types_check(manifest)
  testing_for 'test types'
  expect(manifest.values['test_types']).to_not eq(nil)
  expect(manifest.values['test_types'].empty?).to eq(false)
end
manifest_version_check(manifest) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 42
def manifest_version_check(manifest)
  testing_for 'existence of version'
  expect(manifest.values['version']).to_not eq(nil)
  expect(manifest.values['version'].is_a?(String)).to eq(true)
  expect(manifest.values['version']).to match(/\A[a-zA-Z0-9:._-]+\z/)
end
ok() click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 25
def ok
  puts 'OK'
end
symbolize(h) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 29
def symbolize(h)
  h.each_with_object({}) do |p, obj|
    obj[p.first.to_sym] = p.last
  end
end
testing_for(s) click to toggle source
# File lib/norad_cli/support/manifest_spec.rb, line 21
def testing_for(s)
  puts "Testing for #{s}..."
end