test/test_iri.rb in iri-0.2.0 vs test/test_iri.rb in iri-0.3.0

- old
+ new

@@ -41,10 +41,17 @@ .port('443') .to_s assert_equal('https://localhost:443/?q=books+about+tennis&limit=10', url) end + def test_starts_with_empty_uri + assert_equal( + 'https:', + Iri.new.scheme('https').to_s + ) + end + def test_replaces_scheme assert_equal( 'https://google.com/', Iri.new('http://google.com/').scheme('https').to_s ) @@ -59,9 +66,16 @@ def test_replaces_port assert_equal( 'http://localhost:443/', Iri.new('http://localhost/').port(443).to_s + ) + end + + def test_replaces_fragment + assert_equal( + 'http://localhost/a/b#test', + Iri.new('http://localhost/a/b#before').fragment('test').to_s ) end def test_sets_path assert_equal(