Sha256: 398fde407b6e236987ad1a74b4016fea5ef1e09ede26662588cd083b17daed91
Contents?: true
Size: 1.1 KB
Versions: 12
Compression:
Stored size: 1.1 KB
Contents
require 'cucumber/create_meta' describe 'remove_user_info_from_url' do it 'returns nil for nil' do expect(Cucumber::CreateMeta.remove_userinfo_from_url(nil)).to be_nil end it 'returns empty string for empty string' do expect(Cucumber::CreateMeta.remove_userinfo_from_url('')).to eq('') end it 'leaves the data intact when no sensitive information is detected' do expect(Cucumber::CreateMeta.remove_userinfo_from_url('pretty safe')).to eq('pretty safe') end context 'with URLs' do it 'leaves intact when no password is found' do expect(Cucumber::CreateMeta.remove_userinfo_from_url('https://example.com/git/repo.git')).to eq('https://example.com/git/repo.git') end it 'removes credentials when found' do expect(Cucumber::CreateMeta.remove_userinfo_from_url('http://login@example.com/git/repo.git')).to eq('http://example.com/git/repo.git') end it 'removes credentials and passwords when found' do expect(Cucumber::CreateMeta.remove_userinfo_from_url('ssh://login:password@example.com/git/repo.git')).to eq('ssh://example.com/git/repo.git') end end end
Version data entries
12 entries across 12 versions & 2 rubygems