Sorry for the late response. I merged your patch in r2285.

Thanks a lot :)

Laurent

On Aug 9, 2009, at 8:55 PM, dan sinclair wrote:

Hello,

I started poking at the URI specs to see what I could get working. The attached patch was required to make the specs run (URI provides 11 arguments to initialize).

I then started taking a look at why the equality spec fails and have tracked it back to the dup call not returning the same values in the duplicate object. This can be seen by doing a self.to_s and uri.to_s in the normalize function of lib/uri/generic.rb.

self.to_s -> http://example.com/#fragMENT
uri.to_s ->  http://example.com/

For some reason, the fragment instance variable is being dropped from the duplicated object while all of the other instance variables are being copied over.

You can see the same behaviour with the following script

------------
class  Foo
 def initialize(a, b, c, d, e, f, g, h, i, j, k)
   @a = a
   @b = b
   @c = c
   @d = d
   @e = e
   @f = f
   @g = g
   @h = h
   @i = i
   @j = j
   @k = k
 end

 def to_s
   "#...@a} #...@b} #...@c} #...@d} #...@e} #...@f} #...@g} #...@h} #...@i} #...@j} 
#...@k}"
 end
end

f = Foo.new("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k")
g = f.dup

puts f.to_s
puts g.to_s
-----------

titania:test dj2$ macruby ./dup.rb
a b c d e f g h i j k
a b c d e f g h i j false

dan


<vm_argc.diff>


_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to