test/webloc_test.rb in webloc-0.2.0 vs test/webloc_test.rb in webloc-0.3.0
- old
+ new
@@ -23,11 +23,19 @@
data = File.read(File.dirname(__FILE__) + '/oldstyle.webloc').b
assert_equal data, Webloc.new('https://github.com/peterc/webloc').data
end
def test_webloc_can_handle_long_urls
- url = "http://example.com/this-is-a-very-long-url-indeed-it-should-easily-go-over-110-characters-for-our-testing-purposes"
+ url = "http://example.com/this-is-a-very-long-url-abcde" + ('a' * 2000)
assert_nothing_raised { Webloc.new(url).data }
+ file = Tempfile.new('test-long-webloc')
+ begin
+ Webloc.new(url).save(file.path)
+ assert_equal url, Webloc.load(file.path).url
+ ensure
+ file.close
+ file.unlink
+ end
end
def test_webloc_can_write_file
file = Tempfile.new('test-webloc')
begin
\ No newline at end of file