Trying to pass a unit test;
def test_singleton_method
string1 = "hello"
string2 = "world"
assert string1.respond_to?(:only_one)
assert !string2.respond_to?(:only_one)
end
====
my code to pass it:
string1 = "hello"
string2 = "world"
def string1.only_one
puts "PLEASE WORK"
end
===
yet, this doesn't work, is there something I'm missing?
--
Posted via http://www.ruby-forum.com/.