class Retest::TestOptions::Path

Attributes

pathname[R]

Public Class Methods

new(path) click to toggle source
# File lib/retest/test_options.rb, line 56
def initialize(path)
  @pathname = Pathname(path)
end

Public Instance Methods

possible_test?(file) click to toggle source
# File lib/retest/test_options.rb, line 68
def possible_test?(file)
  possible_test_regex =~ file
end
reversed_dirnames() click to toggle source
# File lib/retest/test_options.rb, line 60
def reversed_dirnames
  @reversed_dirnames ||= dirname.each_filename.to_a.reverse
end
similarity_score(file) click to toggle source
# File lib/retest/test_options.rb, line 72
def similarity_score(file)
  String::Similarity.levenshtein(to_s, file)
end
test?() click to toggle source
# File lib/retest/test_options.rb, line 64
def test?
  test_regex =~ to_s
end

Private Instance Methods

possible_test_regex() click to toggle source
# File lib/retest/test_options.rb, line 82
def possible_test_regex
  Regexp.new(".*#{basename(extname)}_(?:spec|test)#{extname}")
end
test_regex() click to toggle source
# File lib/retest/test_options.rb, line 78
def test_regex
  Regexp.new(".*(?:spec|test)#{extname}")
end