Skip to content

Commit

Permalink
Fix problematic typo in fill [johnmaxwell]
Browse files Browse the repository at this point in the history
  • Loading branch information
nateware committed Sep 16, 2013
1 parent 9ae6f6a commit 5b26788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/redis/hash_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def bulk_set(*args)

# Set keys in bulk if they do not exist. Takes a hash of field/values {'field1' => 'val1'}. Redis: HSETNX
def fill(pairs={})
raise ArgumentErorr, "Arugment to fill must be a hash of key/value pairs" unless pairs.is_a?(::Hash)
raise ArgumentError, "Arugment to fill must be a hash of key/value pairs" unless pairs.is_a?(::Hash)
pairs.each do |field, value|
redis.hsetnx(key, field, to_redis(value, options[:marshal_keys][field]))
end
Expand Down
7 changes: 4 additions & 3 deletions spec/redis_objects_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,15 @@
@hash['foo'].should == 'bar'
@hash['abc'].should == '123'
@hash['bang'].should == 'michael'

it "raises an error if a non-Hash is passed to fill" do
lambda { @hash.fill([]) }.should.raise(ArgumentError)
end
end


after do
@hash.clear
end

end

describe Redis::Set do
Expand Down Expand Up @@ -758,7 +760,6 @@
@set_1.clear
@set_2.clear
@set_3.clear

end
end

Expand Down

0 comments on commit 5b26788

Please sign in to comment.