Permalink
Browse files

very subjective little refactoring

  • Loading branch information...
1 parent 13fd3ef commit 80bdf067758678ee32191c04f4d479031e20606d @dchelimsky dchelimsky committed Dec 13, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rspec/core/filter_manager.rb
@@ -121,13 +121,13 @@ def initialize
end
def add_location(file_path, line_numbers)
- # filter_locations is a hash of expanded paths to arrays of line
+ # locations is a hash of expanded paths to arrays of line
# numbers to match against. e.g.
# { "path/to/file.rb" => [37, 42] }
- filter_locations = @inclusions[:locations] ||= Hash.new {|h,k| h[k] = []}
- filter_locations[File.expand_path(file_path)].push(*line_numbers)
+ locations = @inclusions.delete(:locations) || Hash.new {|h,k| h[k] = []}
+ locations[File.expand_path(file_path)].push(*line_numbers)
+ @inclusions.replace(:locations => locations)
@exclusions.clear
- @inclusions.replace(:locations => filter_locations)
end
def empty?

0 comments on commit 80bdf06

Please sign in to comment.