#28 ✓resolved
Ryan Tomayko

Pass all specs in the basic suite under Ruby 1.9

Reported by Ryan Tomayko | February 2nd, 2009 @ 11:41 AM | in 1.0

I'd like to run through all the specs and convert all uses of strings in response bodies to Arrays. This combined with some kind of header value fix (#27) brings the total number of test failures under Ruby 1.9 down to three for the simple test suite. The fulltest suite is a bit harder because mongrel, thin, fcgi, and memcache are not yet running under 1.9.1.

Comments and changes to this ticket

  • Ryan Tomayko

    Ryan Tomayko February 4th, 2009 @ 12:18 AM

    I have a branch that passes the basic test suite under 1.9.1. More detail on the ML

    http://groups.google.com/group/r...

  • Ryan Tomayko

    Ryan Tomayko February 6th, 2009 @ 08:44 PM

    • State changed from “new” to “resolved”
    • Title changed from “Ruby 1.9: Fix specs that use Strings for response bodies” to “Pass all specs in the basic suite under Ruby 1.9”

    Merged in 732a4fa..51f91a6.

    As mentioned in the email above, most of the fixes were related to one of the following 1.9 specific issues:

    • String#length is used throughout specs and code to determine the length of response bodies. String#bytesize should be used instead. I've fixed all spec failures but there may be other places where #length is used that have not yet surfaced.

    • Array#to_s is used in various specs to turn Array response bodies into Strings. In Ruby 1.8, Array#to_s works like Array#join; in Ruby 1.9, Array#to_s acts like Array#inspect. Breakage ensues. I've converted all cases surfaced by specs to use #join but I wouldn't be surprised if there were additional bugs of this sort hiding elsewhere.

    • File.read assumes the default external encoding. This causes binary data to be treated as UTF-8 in some cases but usually doesn't surface until a Regexp match or some similar operation is performed. I've changed most cases surfaced by specs to instead use: File.open(fn, 'rb') { |f| f.read }

    Huge thanks to everyone that reviewed and gave feedback.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Referenced by

Pages