test/test_iri.rb in iri-0.5.0 vs test/test_iri.rb in iri-0.5.1
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
# (The MIT License)
#
-# Copyright (c) 2019 Yegor Bugayenko
+# Copyright (c) 2019-2021 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -25,11 +25,11 @@
require 'minitest/autorun'
require_relative '../lib/iri'
# Iri test.
# Author:: Yegor Bugayenko (yegor256@gmail.com)
-# Copyright:: Copyright (c) 2019 Yegor Bugayenko
+# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
# License:: MIT
class IriTest < Minitest::Test
def test_builds_uri
url = Iri.new('http://google.com/')
.add(q: 'books about OOP', limit: 50)
@@ -133,9 +133,16 @@
def test_appends_path
assert_equal(
'http://google/a/b/z+%2F+7/42?x=3',
Iri.new('http://google/a/b?x=3').append('z / 7').append(42).to_s
+ )
+ end
+
+ def test_appends_to_empty_ending
+ assert_equal(
+ 'http://google.com/hello',
+ Iri.new('http://google.com/').append('hello').to_s
)
end
def test_appends_empty_path
assert_equal(