Permalink
Browse files

Update UrlShortener::Client#expand to return the

UrlShortener::Response::Expand object and update feature
  • Loading branch information...
1 parent 089c0e4 commit 6719eef1fa1dff6cb70d0c3916b72f0232b1d8f5 nas committed Nov 13, 2009
@@ -59,7 +59,7 @@
end
Then /^the expanded url should be "([^\"]*)" for "([^\"]*)"$/ do |expanded_url, request_parameter|
- @response.result[request_parameter]['longUrl'].should eql(expanded_url)
+ @response.url.should eql(expanded_url)
end
Then /^the result should have "([^\"]*)" and "([^\"]*)" keys in the returned hash$/ do |key1,key2|
@@ -25,7 +25,7 @@ def shorten(*urls)
def expand(option)
check_request_parameters(option)
response = interface(nil, endpoint_with_options('expand',option)).get
- UrlShortener::Response.new(response)
+ UrlShortener::Response::Expand.new(response)
end
# Provide parameter as a key value pair of existing short url or its hash
@@ -230,6 +230,10 @@
@client.expand(:shortUrl => @short_url).result['wesSD'].values.should include('http://www.goog.com')
end
+ it "should return the UrlShortener::Response::Expand object" do
+ @client.expand(:hash => @hash).should be_instance_of(UrlShortener::Response::Expand)
+ end
+
end
end

0 comments on commit 6719eef

Please sign in to comment.