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



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

def add_smoke_test(klass)
  smoke_tests << klass
end

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



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

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



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

def smoke_tests
  @smoke_tests ||= []
end