Skip to content

Commit

Permalink
Randypot.hash_for
Browse files Browse the repository at this point in the history
  • Loading branch information
nando committed Jan 21, 2010
1 parent 1dd3001 commit a7c54ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/randypot.rb
Expand Up @@ -88,7 +88,11 @@ def members
def member(id)
cached_request member_url(id)
end


def hash_for(str)
ParamsTransformer.hash_for str
end

private
def connection
@connection ||= Connection.new(
Expand Down
7 changes: 7 additions & 0 deletions spec/lib/randypot_spec.rb
Expand Up @@ -351,4 +351,11 @@ def set_expectations_for(activity_type, base_params)
end
end

describe '.hash_for' do
it 'should be a wrapper of ParamsTransformer.hash_for' do
str, hash = 'foo', 'bar'
Randypot::ParamsTransformer.should_receive(:hash_for).with(str).and_return(hash)
Randypot.hash_for(str).should == hash
end
end
end

0 comments on commit a7c54ce

Please sign in to comment.