test/test_java_mime.rb in jruby-openssl-0.3 vs test/test_java_mime.rb in jruby-openssl-0.4

- old
+ new

@@ -26,53 +26,53 @@ def test_simple_parse_headers bio = BIO::from_string("Foo: bar") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers2 bio = BIO::from_string("Foo:bar") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers3 bio = BIO::from_string("Foo: bar") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers4 bio = BIO::from_string("Foo: bar\n") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers5 bio = BIO::from_string(" Foo : bar \n") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers6 bio = BIO::from_string("Foo: bar;\n") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - assert_equal MimeHeader.new("Foo", "bar"), result.first - assert_equal "foo", result.first.name + assert_equal MimeHeader.new("Foo", "bar"), result[0] + assert_equal "foo", result[0].name end def test_simple_parse_headers7 bio = BIO::from_string("Foo: bar;\nFlurg: blarg") result = Mime::DEFAULT.parse_headers(bio) @@ -86,47 +86,47 @@ def test_simple_parse_headers_quotes bio = BIO::from_string("Foo: \"bar\"") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size assert_equal MimeHeader.new("Foo", "bar"), result[0] - assert_equal "foo", result.first.name + assert_equal "foo", result[0].name end def test_simple_parse_headers_comment bio = BIO::from_string("Foo: (this is the right thing)ba(and this is the wrong one)r") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size assert_equal MimeHeader.new("Foo", "(this is the right thing)ba(and this is the wrong one)r"), result[0] - assert_equal "foo", result.first.name + assert_equal "foo", result[0].name end def test_parse_headers_with_param bio = BIO::from_string("Content-Type: Multipart/Related; boundary=MIME_boundary; type=text/xml") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - header = result.first + header = result[0] assert_equal "content-type", header.name assert_equal "multipart/related", header.value assert_equal [MimeParam.new("boundary","MIME_boundary"), MimeParam.new("type","text/xml")], header.params.to_a end def test_parse_headers_with_param_newline bio = BIO::from_string("Content-Type: Multipart/Related\n boundary=MIME_boundary; type=text/xml") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - header = result.first + header = result[0] assert_equal "content-type", header.name assert_equal "multipart/related", header.value assert_equal [MimeParam.new("boundary","MIME_boundary"), MimeParam.new("type","text/xml")], header.params.to_a end def test_parse_headers_with_param_newline_and_semicolon bio = BIO::from_string("Content-Type: Multipart/Related;\n boundary=MIME_boundary;\n Type=text/xml") result = Mime::DEFAULT.parse_headers(bio) assert_equal 1, result.size - header = result.first + header = result[0] assert_equal "content-type", header.name assert_equal "multipart/related", header.value assert_equal [MimeParam.new("boundary","MIME_boundary"), MimeParam.new("type","text/xml")], header.params.to_a end