Skip to content

Commit

Permalink
Merge pull request petergoldstein#191 from teeparham/warn-compress
Browse files Browse the repository at this point in the history
fix warning about valid :compress option
  • Loading branch information
mperham committed Apr 5, 2012
2 parents 68c498b + 785805e commit 669bd18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_support/cache/dalli_store.rb
Expand Up @@ -20,7 +20,7 @@ class DalliStore
def initialize(*addresses)
addresses = addresses.flatten
options = addresses.extract_options!
options[:compression] = options.delete(:compress) || options[:compression]
options[:compress] ||= options[:compression]
addresses << 'localhost:11211' if addresses.empty?
@data = Dalli::Client.new(addresses, options)
end
Expand Down
7 changes: 7 additions & 0 deletions test/test_dalli.rb
Expand Up @@ -6,6 +6,13 @@
should 'handle deprecated options' do
dc = Dalli::Client.new('foo', :compression => true)
assert dc.instance_variable_get(:@options)[:compress]
refute dc.instance_variable_get(:@options)[:compression]
end

should 'not warn about valid options' do
dc = Dalli::Client.new('foo', :compress => true)
# Rails.logger.expects :warn
assert dc.instance_variable_get(:@options)[:compress]
end
end

Expand Down

0 comments on commit 669bd18

Please sign in to comment.