AndrewRadev / vimrunner

Control a vim instance through ruby code
MIT License
238 stars 13 forks source link

Fix server name, vim only allow upcase #27

Closed zhaocai closed 11 years ago

mudge commented 11 years ago

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.

AndrewRadev commented 11 years ago

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.