Module: PriorityTest::RSpec2::RelativePath

Defined in:
lib/priority_test/rspec2/relative_path.rb

Class Method Summary collapse

Class Method Details

.convert(absolute_path) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/priority_test/rspec2/relative_path.rb', line 4

def self.convert(absolute_path)
  relative_path = absolute_path.sub(File.expand_path("."), ".")
  relative_path = relative_path.sub(/\A([^:]+:\d+)$/, '\\1')
  return nil if relative_path == '-e:1'

  relative_path
end