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


Attachment: vm_argc.diff
Description: Binary data




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

Reply via email to