Class: Fried::Test::LoadTestFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/fried/test/load_test_files.rb

Overview

Load test files using require_relative

Defined Under Namespace

Classes: Substitute

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLoadTestFiles

Returns a new instance of LoadTestFiles.



21
22
23
24
# File 'lib/fried/test/load_test_files.rb', line 21

def initialize
  @get_test_files = GetTestFiles.new
  @get_single_test_file = GetSingleTestFile.new
end

Instance Attribute Details

#get_single_test_fileObject

Returns the value of attribute get_single_test_file.



19
20
21
# File 'lib/fried/test/load_test_files.rb', line 19

def get_single_test_file
  @get_single_test_file
end

#get_test_filesObject

Returns the value of attribute get_test_files.



18
19
20
# File 'lib/fried/test/load_test_files.rb', line 18

def get_test_files
  @get_test_files
end

Class Method Details

.buildObject



26
27
28
29
30
31
# File 'lib/fried/test/load_test_files.rb', line 26

def self.build
  new.tap do |instance|
    instance.get_test_files = GetTestFiles.build
    instance.get_single_test_file = GetSingleTestFile.build
  end
end

.call(options = Options::Default) ⇒ Object



33
34
35
36
# File 'lib/fried/test/load_test_files.rb', line 33

def self.call(options = Options::Default)
  instance = build
  instance.(options)
end

Instance Method Details

#call(options = Options::Default) ⇒ void

This method returns an undefined value.



39
40
41
42
# File 'lib/fried/test/load_test_files.rb', line 39

def call(options = Options::Default)
  test_files = fetch_files(options)
  test_files.each { |file| require_relative file.to_s }
end