Class: Pathname
- Inherits:
-
Object
- Object
- Pathname
- Defined in:
- lib/rspec-puppet/monkey_patches.rb
Instance Method Summary collapse
Instance Method Details
#rspec_puppet_basename(path) ⇒ Object
212 213 214 215 216 217 218 219 |
# File 'lib/rspec-puppet/monkey_patches.rb', line 212 def rspec_puppet_basename(path) raise ArgumentError, 'pathname stubbing not enabled' unless RSpec.configuration.enable_pathname_stubbing if path =~ /\A[a-zA-Z]:(#{SEPARATOR_PAT}.*)\z/ path = path[2..-1] end path.split(SEPARATOR_PAT).last || path[/(#{SEPARATOR_PAT})/, 1] || path end |