Skip to content

Commit

Permalink
refactoring names
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiekherod committed Jul 21, 2011
1 parent f7aca4e commit 5281be9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/loris/base.rb
Expand Up @@ -11,9 +11,9 @@ module Loris

def self.mode
if arguments[:file] and arguments[:line_number]
:find_files
:line
else
:collect_tests
:project
end
end

Expand Down
6 changes: 3 additions & 3 deletions lib/loris/report.rb
Expand Up @@ -13,15 +13,15 @@ def self.puke_out_report(options = {})
groups.sort! {|a, b| b.keys.length <=> a.keys.length }
grouped_lines = data_grouped(Loris.data, groups)
groups.each_with_index do |group, index|
if Loris.mode == :find_files
if Loris.mode == :line
header = "\nLine #{Loris.arguments[:line_number]} in file #{Loris.arguments[:file]}"
header << " has been touched by #{group.length} test case(s): "
else
header = "\nThe following files has been touched by #{group.length} different test cases: "
end
header << group.map { |suite, cases| "#{suite} (#{cases.join(', ')})" }.join(', ')
STDOUT.puts header
if Loris.mode != :find_files
if Loris.mode != :line
grouped_lines[index].each do |file, lines|
STDOUT.puts file
lines.sort.each do |line|
Expand All @@ -34,7 +34,7 @@ def self.puke_out_report(options = {})

private
def self.condition(test_cases, file, line_number)
if Loris.mode == :find_files
if Loris.mode == :line
file == File.expand_path(Loris.arguments[:file]) && (line_number + 1) == Loris.arguments[:line_number].to_i
else
test_cases.length > 1
Expand Down

0 comments on commit 5281be9

Please sign in to comment.