Class: DeltaTest::CLI::SpecsCommand

Inherits:
CommandBase show all
Defined in:
lib/delta_test/cli/specs_command.rb

Constant Summary

Constants inherited from CommandBase

CommandBase::DEFAULT_OPTIONS

Instance Method Summary collapse

Methods inherited from CommandBase

#bundler_enabled?, #exec_with_data, #exit_with_message, #initialize, #invoke, #parse_options!

Constructor Details

This class inherits a constructor from DeltaTest::CLI::CommandBase

Instance Method Details

#invoke!Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/delta_test/cli/specs_command.rb', line 9

def invoke!
  if stats.base_commit
    puts 'Base commit: %s' % [stats.base_commit]
    puts
  else
    raise StatsNotFoundError
  end

  list.load_table!(stats.table_file_path)
  list.retrive_changed_files!(stats.base_commit)

  print_specs
end

#listObject



27
28
29
# File 'lib/delta_test/cli/specs_command.rb', line 27

def list
  @list ||= RelatedSpecList.new
end


31
32
33
34
35
36
37
38
39
# File 'lib/delta_test/cli/specs_command.rb', line 31

def print_specs
  files = list.related_spec_files.to_a

  if files.any?
    puts files
  else
    puts '(no spec files to run)'
  end
end

#statsObject



23
24
25
# File 'lib/delta_test/cli/specs_command.rb', line 23

def stats
  @stats ||= Stats.new
end