Skip to content

Commit

Permalink
fixing symbols and strings. moving the method to the right module
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Dec 29, 2010
1 parent ed54f24 commit 9676d98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/restfulie/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ module Restfulie
module Common
autoload :Error, 'restfulie/common/error'
autoload :Logger, 'restfulie/common/logger'
end

def self.extract_link_header(links)
links.collect {|link| "<#{link.href}>; rel=#{link.rel}"}.join(', ')
def self.extract_link_header(links)
links.collect {|link| "<#{link.href}>; rel=#{link.rel}"}.join(', ')
end
end

end

4 changes: 2 additions & 2 deletions spec/unit/common_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

describe Restfulie::Common do
it "should extract link header from links" do
link1 = Medie::Link.new(:rel => "home", :href => "http://google.com")
link2 = Medie::Link.new(:rel => "next", :href => "http://google.com?q=ruby")
link1 = Medie::Link.new("rel" => "home", "href" => "http://google.com")
link2 = Medie::Link.new("rel" => "next", "href" => "http://google.com?q=ruby")
links = [link1, link2]

Restfulie::Common.extract_link_header(links).should == "<http://google.com>; rel=home, <http://google.com?q=ruby>; rel=next"
Expand Down

0 comments on commit 9676d98

Please sign in to comment.