[MacRuby] #336: Defining a method with a colon somewhere in the name and whitespace at the end will loose the trailing whitespace. (was: NoMethodError with shoulda tests)
MacRuby
ruby-noreply at macosforge.org
Mon Mar 21 15:35:03 PDT 2011
#336: Defining a method with a colon somewhere in the name and whitespace at the
end will loose the trailing whitespace. (was: NoMethodError with shoulda
tests)
----------------------------------------+-----------------------------------
Reporter: macruby@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: major | Milestone: MacRuby 1.0
Component: MacRuby | Keywords: #reduction
----------------------------------------+-----------------------------------
Comment(by cyberfox@…):
Greetings,
Just to be clear, defining a method with a single colon in it will remove
ANY last character.
e.g.
{{{
class Y
define_method(:"method with :colon and ending with non-whitespace") {}
p instance_methods(false)
end
}}}
outputs
{{{
[:"method with :colon and ending with non-whitespac"]
}}}
...which might be considered a more serious bug.
I've tried defining it with various arities, and they have different
subtle oddities, e.g.
{{{
class XY
define_method(:"method with :colon and ending with non-whitespace") {
|*x| puts x}
p instance_methods(false)
end
}}}
outputs
{{{
[:"method with :colon and ending with non-whitespace:", :"method with
:colon and ending with non-whitespac"]
}}}
Hope this info helps!
-- Morgan Schweers
--
Ticket URL: <http://www.macruby.org/trac/ticket/336#comment:10>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list