Tests are not passing #3

Open
paneq opened this Issue Jun 24, 2012 · 13 comments

Projects

None yet

4 participants

@paneq
/home/rupert/binary/ruby-1.9.2-p290/bin/ruby -w -I"lib:test" -I"/home/rupert/binary/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib" "/home/rupert/binary/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/rake_test_loader.rb" "test/multipart_parser/parser_test.rb" "test/multipart_parser/reader_test.rb" 
Loaded suite /home/rupert/binary/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.3.beta.1/lib/rake/rake_test_loader
Started
F....FF
Finished in 0.001119 seconds.

  1) Failure:
test_fixtures(MultipartParser::ParserTest) [/home/rupert/develop/multipart-parser/test/multipart_parser/parser_test.rb:88]:
<true> expected but was
<false>.

  2) Failure:
test_long(MultipartParser::ReaderTest) [/home/rupert/develop/multipart-parser/test/multipart_parser/reader_test.rb:97]:
Failed assertion, no message given.

  3) Failure:
test_success_scenario(MultipartParser::ReaderTest) [/home/rupert/develop/multipart-parser/test/multipart_parser/reader_test.rb:57]:
Failed assertion, no message given.

7 tests, 11 assertions, 3 failures, 0 errors, 0 skips

Including the one that I submitted in another pull request.

@danabr
Owner

Thanks for the heads-up. When I wrote this, I was running it under 1.8.7, where the (old) tests still pass. Running them under 1.9 produces the errors you mention, though. I'm on vacation this week, meaning that I might actually be able to look into it :)

@danabr danabr referenced this issue Aug 21, 2012
Merged

Ruby 1.9 support #4

@Asmod4n

@danabr i am also getting errors with html5 FormData in all Webkit browsers at least, could you take a look at it?

@danabr
Owner

Hi Hendrik,

I wrote/converted this multipart parser many years ago now, and have not used it after the first project (a prototype for my thesis project) I needed it for. I'm not convinced I remember enough details to be able to solve the problems.

I'll try to have a look this week, but I won't promise anything. Feel free to come up with a patch!

@Asmod4n

@danabr when i take a look at a normal form and a javascript FormData i can't see a difference, but its complaining https://github.com/danabr/multipart-parser/blob/master/lib/multipart_parser/reader.rb#L46 here, maybe newline handling isn't corrent?

@danabr
Owner

I intend test some different scenarios with recent browsers to try to understand the issue. You can help by sending the raw multipart message that the browser sends to the server, so that we can use it as a test case.

@danabr
Owner

I've done tests with the most recent firefox and chromium recently, and I have been able to parse form data generated by them. To me it seems like the "long boundary" test is incorrect. But you are saying you have problems parsing real, browser-generated, multipart/form-data messages, right?

@Asmod4n
@danabr
Owner

Could you start a netcat session with "nc -l 8888", and then make your form post to "localhost:8888", and then post the output (from netcat) here?

@Asmod4n
@digitalextremist

@Asmod4n I am using Safari, testing a celluloid/reel implementation of this library, and I've successfully used moxiecode/plupload ( html5 mode ) and an ordinary html form field. So I've used JavaScript FormData successfully.

Once I post the code to a branch of Reel, maybe we can find what's going on for you?

@Asmod4n

Oh i forgot, have used it inside a web worker for chunked uploading, and since FormData is not available there i took https://gist.github.com/lemonhall/3120320 as a polyfill, maybe the error is there.

Made a gist of a now disfunct uploader: https://gist.github.com/Asmod4n/28e5440fd47af471da9c
crypto.js is from https://code.google.com/p/crypto-js/

@digitalextremist

Will check that out shortly, and be in #celluloid to talk if you're around.

@danabr
Owner

Again, it would be helpful to get the full request sent to the server (by using netcat, for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment