Class: Attest::TestLoader

Inherits:
Object show all
Defined in:
lib/attest/test_loader.rb

Class Method Summary collapse

Class Method Details

.execute(possible_tests, output_writer) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/attest/test_loader.rb', line 7

def execute(possible_tests, output_writer)
  switch_on_attest_mode
  output_writer.before_all_tests
  possible_tests.each do |ruby_file|
    Attest.config.current_file = ruby_file
    load ruby_file 
  end
  output_writer.after_all_tests
  output_writer.summary
  switch_off_attest_mode
end

.switch_off_attest_modeObject



23
24
25
# File 'lib/attest/test_loader.rb', line 23

def switch_off_attest_mode
  ENV["attest"] = nil
end

.switch_on_attest_modeObject



19
20
21
# File 'lib/attest/test_loader.rb', line 19

def switch_on_attest_mode
  ENV["attest"] = "true"
end