Class: Cucover::CliCommands::ShowRecordings

Inherits:
Object
  • Object
show all
Defined in:
lib/cucover/cli_commands/show_recordings.rb

Instance Method Summary collapse

Constructor Details

#initialize(cli_args) ⇒ ShowRecordings

Returns a new instance of ShowRecordings.



4
5
6
# File 'lib/cucover/cli_commands/show_recordings.rb', line 4

def initialize(cli_args)
  @store = Store.new
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/cucover/cli_commands/show_recordings.rb', line 8

def execute
  unless recordings.any?
    puts "No recordings to show. Run some tests with cucover first."
    return
  end
  
  recordings.each do |recording|
    puts
    puts "#{recording.file_colon_line}" # (#{recording.start_time.strftime('%Y-%m-%d %H:%M:%S')})
    recording.covered_files.each do |covered_file|
      puts "  #{covered_file.to_s}"
    end
  end
  puts
end

#recordingsObject



24
25
26
# File 'lib/cucover/cli_commands/show_recordings.rb', line 24

def recordings
  @recordings ||= @store.latest_recordings.sort{ |x, y| x.file_colon_line <=> y.file_colon_line }
end