mtheoryx/goiu_shorten — Issue #13: remove hash argument in expand method
Author: mtheoryx
Created: 2012-03-06 15:09:25+00:00
State: open
Labels: bug

From xyzzy_b:

One bug: you don't really need to accept a hash of arguments on the expand method.
def expand(*short_url)
That's causing the test in this line to never be true:
if short_url.nil? then raise ArgumentError end
The spec passes, but only because it falls out to "ERR URL not found - Please correct and try again."
To fix, just drop the *
def expand(*short_url)
And then change the spec (it "should return an error if you don't supply a short url") to
GoiuShorten.expand(nil).should raise_error
ArgumentError is actually an error, not an exception.