Sha256: e7c52081c1b38fbfc8537543a6063587881e61e4634cc491947c690a00e4e6ac
Contents?: true
Size: 866 Bytes
Versions: 33
Compression:
Stored size: 866 Bytes
Contents
# frozen_string_literal = true class Ree::SpecRunner::SpecFilenameMatcher class << self def find_matches(package_path:, spec_matcher:) Ree::SpecRunner::SpecFilenameMatcher.new(package_path, spec_matcher).find_matches end end def initialize(package_path, spec_matcher) @package_path = File.expand_path(package_path) @spec_matcher = spec_matcher end def find_matches expected_filename = File.join(@package_path, @spec_matcher) if File.exist?(expected_filename) return Pathname.new(expected_filename).relative_path_from(Pathname.new(@package_path)).to_s.split end Dir.glob(File.join(@package_path, '**/*_spec.rb')) .select { |fn| File.file?(fn) } .map {|file| Pathname.new(file).relative_path_from(Pathname.new(@package_path)).to_s } .grep(/#{@spec_matcher.split('').join('.*')}/) end end
Version data entries
33 entries across 33 versions & 1 rubygems