CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/lib/rex/ntpath_spec.rb
Views: 1904
1
# frozen_string_literal: true
2
3
require 'rspec'
4
5
RSpec.describe Rex::Ntpath do
6
7
describe '#as_ntpath' do
8
let(:valid_windows_path) { 'some\\path\\that\\is\\valid' }
9
10
[
11
'some\\path\\that\\is\\valid',
12
'some/path/that/is/valid',
13
'some/./path/that/./is/valid',
14
'some/extra/../path/that/extra/../is/valid',
15
'/some/path/that/is/valid'
16
].each do |path|
17
context "when the path is #{path}" do
18
it 'formats it as a valid ntpath' do
19
formatted_path = described_class.as_ntpath(path)
20
expect(formatted_path).to eq valid_windows_path
21
end
22
end
23
end
24
end
25
end
26
27