test/test_iri.rb in iri-0.4.0 vs test/test_iri.rb in iri-0.4.1
- old
+ new
@@ -71,13 +71,17 @@
)
end
def test_replaces_fragment
assert_equal(
- 'http://localhost/a/b#test',
- Iri.new('http://localhost/a/b#before').fragment('test').to_s
+ 'http://localhost/a/b#test%20me',
+ Iri.new('http://localhost/a/b#before').fragment('test me').to_s
)
+ assert_equal(
+ 'http://localhost/#42',
+ Iri.new('http://localhost/').fragment(42).to_s
+ )
end
def test_sets_path
assert_equal(
'http://localhost/hey/you?i=8#test',
@@ -90,11 +94,11 @@
'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
+ def test_removes_path
assert_equal(
'http://localhost/',
Iri.new('http://localhost/hey?i=8#test').cut.to_s
)
end
@@ -117,11 +121,11 @@
)
end
def test_appends_path
assert_equal(
- 'http://google/a/b/z+%2F+7?x=3',
- Iri.new('http://google/a/b?x=3').append('z / 7').to_s
+ '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_replaces_query_param
assert_equal(