File: parse_spec.rb

package info (click to toggle)
ruby-mdurl-rb 1.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: ruby: 1,077; makefile: 7
file content (16 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'mdurl-rb'
describe 'parse' do
  
  URL_TEST_DATA.each_pair do |url, result|

    it "#{url}" do
      parsed = MDUrl::Url.urlParse(url)

      (expect(parsed.protocol).to eq result['protocol']) if parsed.protocol
      (expect(parsed.slashes).to  eq result['slashes'])  if parsed.slashes
      (expect(parsed.hostname).to eq result['hostname']) if parsed.hostname
      (expect(parsed.pathname).to eq result['pathname']) if parsed.pathname
    end

  end
end