Class: Fried::Test::GetSingleTestFile

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

Constant Summary collapse

CurrentWorkingDirectory =
Directory::CurrentWorkingDirectory

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGetSingleTestFile

Returns a new instance of GetSingleTestFile.



10
11
12
# File 'lib/fried/test/get_single_test_file.rb', line 10

def initialize
  self.current_working_directory = CurrentWorkingDirectory.new
end

Instance Attribute Details

#current_working_directoryObject

Returns the value of attribute current_working_directory.



8
9
10
# File 'lib/fried/test/get_single_test_file.rb', line 8

def current_working_directory
  @current_working_directory
end

Class Method Details

.buildObject



14
15
16
17
18
# File 'lib/fried/test/get_single_test_file.rb', line 14

def self.build
  new.tap do |instance|
    instance.current_working_directory = CurrentWorkingDirectory.build
  end
end

.call(file) ⇒ Object



20
21
22
23
# File 'lib/fried/test/get_single_test_file.rb', line 20

def self.call(file)
  instance = build
  instance.(file)
end

Instance Method Details

#call(file) ⇒ Array<Pathname>

Parameters:

  • file (String)

Returns:

  • (Array<Pathname>)


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

def call(file)
  directory = current_working_directory.()
  test_file_path = directory.join(file.to_s)

  [test_file_path]
end