rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Rack test spec_rack_mock fails on JRuby due to Fixnum equal? behavior
@ 2010-01-17 18:49 Charles Oliver Nutter
  2010-01-18  7:00 ` Christian Neukirchen
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Oliver Nutter @ 2010-01-17 18:49 UTC (permalink / raw)
  To: Rack Development

This test fails in JRuby because of some slight difference in YAML
rendering:

  specify "should provide access to the HTTP headers" do
    res = Rack::MockRequest.new(app).get("")
    res.should.include "Content-Type"
    res.headers["Content-Type"].should.equal "text/yaml"
    res.original_headers["Content-Type"].should.equal "text/yaml"
    res["Content-Type"].should.equal "text/yaml"
    res.content_type.should.equal "text/yaml"
    res.content_length.should.be 414  # needs change often.
    res.location.should.be.nil
  end

On JRuby, the content length comes out as 418 instead of 414, because
the rack.version renders with leading spaces:

(line numbers added)
1: rack.version:
2:  - 1
3:  - 1

Versus the MRI output:

1: rack.version:
2: - 1
3: - 1

I'm not sure of the best way to resolve this one.

- Charlie

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Rack test spec_rack_mock fails on JRuby due to Fixnum equal?  behavior
  2010-01-17 18:49 Rack test spec_rack_mock fails on JRuby due to Fixnum equal? behavior Charles Oliver Nutter
@ 2010-01-18  7:00 ` Christian Neukirchen
  2010-01-18 17:15   ` Charles Oliver Nutter
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Neukirchen @ 2010-01-18  7:00 UTC (permalink / raw)
  To: rack-devel

On Sun, Jan 17, 2010 at 7:49 PM, Charles Oliver Nutter
<headius@headius.com> wrote:
>
> I'm not sure of the best way to resolve this one.

We should stop comparing content-lengths, it was a bad idea.

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Rack test spec_rack_mock fails on JRuby due to Fixnum equal?  behavior
  2010-01-18  7:00 ` Christian Neukirchen
@ 2010-01-18 17:15   ` Charles Oliver Nutter
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Oliver Nutter @ 2010-01-18 17:15 UTC (permalink / raw)
  To: rack-devel

On Mon, Jan 18, 2010 at 1:00 AM, Christian Neukirchen
<chneukirchen@gmail.com> wrote:
> We should stop comparing content-lengths, it was a bad idea.

That would be ideal :)

And sorry for the subject of this email...I originally thought it was
the Fixnum comparison, and found out mid-email the values were
actually different.

- Charlie

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-18 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-17 18:49 Rack test spec_rack_mock fails on JRuby due to Fixnum equal? behavior Charles Oliver Nutter
2010-01-18  7:00 ` Christian Neukirchen
2010-01-18 17:15   ` Charles Oliver Nutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).