test/test_iri.rb in iri-0.7.0 vs test/test_iri.rb in iri-0.8.0

- old
+ new

@@ -1,10 +1,10 @@ # frozen_string_literal: true # (The MIT License) # -# Copyright (c) 2019-2023 Yegor Bugayenko +# Copyright (c) 2019-2024 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-2023 Yegor Bugayenko +# Copyright:: Copyright (c) 2019-2024 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) @@ -44,9 +44,21 @@ end def test_broken_uri assert_raises Iri::InvalidURI do Iri.new('https://example.com/>', safe: false).add(a: 1) + end + end + + def test_incorrect_call_of_add + assert_raises Iri::InvalidArguments do + Iri.new('https://example.com/').add('hello5') + end + end + + def test_incorrect_call_of_over + assert_raises Iri::InvalidArguments do + Iri.new('https://example5.com/').over('boom44') end end def test_broken_uri_in_safe_mode Iri.new('https://example.com/>>>').add(a: 1)