Class: NoradSpecRunner::SecTest

Inherits:
Object
  • Object
show all
Defined in:
lib/norad_spec_runner/sec_test.rb

Direct Known Subclasses

LinuxSecTest

Constant Summary collapse

UNSUPPORTED_SPEC_FILE =
"#{File.expand_path(File.dirname(__FILE__))}/support/os_not_supported_spec.rb"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tests_parent_dir, test_name, platform) ⇒ SecTest



6
7
8
9
10
11
# File 'lib/norad_spec_runner/sec_test.rb', line 6

def initialize(tests_parent_dir, test_name, platform)
  @tests_parent_dir = tests_parent_dir
  @test_name = test_name
  @platform = platform
  print_detection_message
end

Instance Attribute Details

#platformObject (readonly)

Returns the value of attribute platform.



4
5
6
# File 'lib/norad_spec_runner/sec_test.rb', line 4

def platform
  @platform
end

#test_nameObject (readonly)

Returns the value of attribute test_name.



4
5
6
# File 'lib/norad_spec_runner/sec_test.rb', line 4

def test_name
  @test_name
end

#tests_parent_dirObject (readonly)

Returns the value of attribute tests_parent_dir.



4
5
6
# File 'lib/norad_spec_runner/sec_test.rb', line 4

def tests_parent_dir
  @tests_parent_dir
end

Instance Method Details

#default_test_fileObject



25
26
27
# File 'lib/norad_spec_runner/sec_test.rb', line 25

def default_test_file
  UNSUPPORTED_SPEC_FILE
end

#suggested_test_fileObject



21
22
23
# File 'lib/norad_spec_runner/sec_test.rb', line 21

def suggested_test_file
  "#{test_name}/#{platform}_spec.rb"
end

#suggested_test_file_exists?Boolean



17
18
19
# File 'lib/norad_spec_runner/sec_test.rb', line 17

def suggested_test_file_exists?
  File.exist?("#{tests_parent_dir}/#{suggested_test_file}")
end

#test_to_runObject



13
14
15
# File 'lib/norad_spec_runner/sec_test.rb', line 13

def test_to_run
  suggested_test_file_exists? ? suggested_test_file : default_test_file
end