Last active
December 29, 2015 10:19
-
-
Save debbbbie/7656037 to your computer and use it in GitHub Desktop.
Add a test: every redis commands should be realized in redis-namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "every redis commands should be realized in redis-namespace" do | |
# Use methods.map{|m|m.to_sym} for backward compatible till ruby1.8 | |
r_methods = (Redis.public_instance_methods(false) - MonitorMixin.public_instance_methods).map{|m|m.to_sym} - | |
[:client, :synchronize, :with_reconnect, :without_reconnect, :connected?, :id, :method_missing, :inspect, :_bpop, :_eval, :_scan ] | |
rns_methods = (Redis::Namespace::COMMANDS.keys + Redis::Namespace.public_instance_methods(false)).map{|m|m.to_sym} | |
do_not_needs = [:slowlog, :sync, :time, :migrate, :subscribed?, :unwatch, :script] | |
(r_methods - rns_methods - do_not_needs).should eq([]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment