Class: Kapnismology::SmokeTestCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/kapnismology/smoke_test_collection.rb

Overview

This class maintains the collection of all the smoke tests found in the system

Class Method Summary collapse

Class Method Details

.add_smoke_test(klass) ⇒ Object



8
9
10
# File 'lib/kapnismology/smoke_test_collection.rb', line 8

def add_smoke_test(klass)
  smoke_tests << klass
end

.evaluations(allowed_tags = [SmokeTest::RUNTIME_TAG], blacklist = []) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/kapnismology/smoke_test_collection.rb', line 16

def evaluations(allowed_tags = [SmokeTest::RUNTIME_TAG], blacklist = [])
  # We will run any class which categories are in the allowed list
  # and not blacklisted
  runable_tests = smoke_tests.select do |test|
    klass_name = test.name.split('::').last
    !blacklist.include?(klass_name) &&
      !(allowed_tags & test.tags).empty?
  end
  EvaluationCollection.new(runable_tests)
end

.smoke_testsObject



12
13
14
# File 'lib/kapnismology/smoke_test_collection.rb', line 12

def smoke_tests
  @smoke_tests ||= []
end