Could we add a failing test to show that names should always be uppercased (to prevent issues with serverlist)?
Perhaps something like:
server = Vimrunner::Server.new(:name => "foo")
server.name.should eq("FOO")
As an aside: I wonder if we should be more defensive with the type of name before calling upcase on it (to provide a more useful error than the usual NoMethodError: undefined methodupcase' for nil:NilClass. I was hopingKernel#Stringwould throw an error givennilbut it just returns the empty string which would probably hide the true source of the error even further. I guess theNoMethodError` fails early enough to be useful.
I thought this pull request would be merged a lot earlier, but I guess it kind of got left behind by everyone :). I merged it and copied over @mudge's test case.
Could we add a failing test to show that names should always be uppercased (to prevent issues with
serverlist
)?Perhaps something like:
As an aside: I wonder if we should be more defensive with the type of
name
before callingupcase
on it (to provide a more useful error than the usualNoMethodError: undefined method
upcase' for nil:NilClass. I was hoping
Kernel#Stringwould throw an error given
nilbut it just returns the empty string which would probably hide the true source of the error even further. I guess the
NoMethodError` fails early enough to be useful.