Class: Ree::SpecRunner::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/ree/spec_runner/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil, package: nil, spec_matcher: nil, show_missing_packages: true, stdout: $stdout, show_output: true) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
11
12
13
14
15
16
# File 'lib/ree/spec_runner/runner.rb', line 7

def initialize(path: nil, package: nil, spec_matcher: nil, show_missing_packages: true,
              stdout: $stdout, show_output: true )
  @package_name = package
  @no_specs_packages = []
  @spec_matcher = spec_matcher.to_s.split(':')[0]
  @spec_string_number = spec_matcher.to_s.split(':')[1].to_i
  @path = path
  @stdout = stdout
  @show_output = show_output
end

Instance Attribute Details

#no_specs_packagesObject

Returns the value of attribute no_specs_packages.



4
5
6
# File 'lib/ree/spec_runner/runner.rb', line 4

def no_specs_packages
  @no_specs_packages
end

#prepared_command_paramsObject

Returns the value of attribute prepared_command_params.



5
6
7
# File 'lib/ree/spec_runner/runner.rb', line 5

def prepared_command_params
  @prepared_command_params
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ree/spec_runner/runner.rb', line 18

def run
  if @spec_matcher
    find_matched_files(@package_name)
  end

  prepare!
  check_input_params!
  display_missing_specs if @show_missing_packages
  print_message view.specs_header_message if @show_missing_packages

  execute_command
end