test/test_iri.rb in iri-0.1.0 vs test/test_iri.rb in iri-0.2.0
- old
+ new
@@ -62,9 +62,30 @@
'http://localhost:443/',
Iri.new('http://localhost/').port(443).to_s
)
end
+ def test_sets_path
+ assert_equal(
+ 'http://localhost/hey/you?i=8#test',
+ Iri.new('http://localhost/hey?i=8#test').path('/hey/you').to_s
+ )
+ end
+
+ def test_sets_query
+ assert_equal(
+ 'http://localhost/hey?t=1#test',
+ Iri.new('http://localhost/hey?i=8#test').query('t=1').to_s
+ )
+ end
+
+ def test_removes_query_and_path
+ assert_equal(
+ 'http://localhost/',
+ Iri.new('http://localhost/hey?i=8#test').cut.to_s
+ )
+ end
+
def test_adds_query_param
assert_equal(
'http://google/?a=1&a=3&b=2',
Iri.new('http://google/').add(a: 1, b: 2).add(a: 3).to_s
)