Class: Fried::Test::CLI

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



16
17
18
19
20
21
22
# File 'lib/fried/test/cli.rb', line 16

def initialize
  @load_tests_path = LoadTestsPath.new
  @load_test_files = LoadTestFiles.new
  @load_plugins = LoadPlugins.new
  @autorun = Autorun.new
  @get_options = GetOptions.new
end

Instance Attribute Details

#autorunObject

Returns the value of attribute autorun.



13
14
15
# File 'lib/fried/test/cli.rb', line 13

def autorun
  @autorun
end

#get_optionsObject

Returns the value of attribute get_options.



14
15
16
# File 'lib/fried/test/cli.rb', line 14

def get_options
  @get_options
end

#load_pluginsObject

Returns the value of attribute load_plugins.



12
13
14
# File 'lib/fried/test/cli.rb', line 12

def load_plugins
  @load_plugins
end

#load_test_filesObject

Returns the value of attribute load_test_files.



11
12
13
# File 'lib/fried/test/cli.rb', line 11

def load_test_files
  @load_test_files
end

#load_tests_pathObject

Returns the value of attribute load_tests_path.



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

def load_tests_path
  @load_tests_path
end

Class Method Details

.buildObject



24
25
26
27
28
29
30
31
32
# File 'lib/fried/test/cli.rb', line 24

def self.build
  new.tap do |instance|
    instance.load_tests_path = LoadTestsPath.build
    instance.load_test_files = LoadTestFiles.build
    instance.load_plugins = LoadPlugins.build
    instance.autorun = Autorun.build
    instance.get_options = GetOptions.build
  end
end

.call(argv = ARGV) ⇒ Object



42
43
44
45
# File 'lib/fried/test/cli.rb', line 42

def self.call(argv = ARGV)
  instance = build
  instance.(argv)
end

Instance Method Details

#call(argv = ARGV) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/fried/test/cli.rb', line 34

def call(argv = ARGV)
  load_plugins.()
  options = get_options.(argv)
  load_tests_path.()
  load_test_files.(options)
  autorun.()
end