class Guard::RSpec::Dsl
def self.detect_spec_file_for(rspec, file)
def self.detect_spec_file_for(rspec, file) # TODO: when spec not found ... run specs in topmost found path? # Or show warning? path = "#{rspec.spec_dir}/#{file}_spec.rb" return path unless file.start_with?("lib/") return path if Dir.exist?("#{rspec.spec_dir}/lib") without_lib = file.sub(%r{^lib/}, "") "#{rspec.spec_dir}/#{without_lib}_spec.rb" end