From 18cc5deb32b8639aa89ddaa57127f9203615e044 Mon Sep 17 00:00:00 2001 From: Matthew Shafer Date: Fri, 10 May 2013 13:49:17 -0700 Subject: [PATCH] Fix reset! method in tankard configuration --- lib/tankard.rb | 4 ++++ lib/tankard/configuration.rb | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/tankard.rb b/lib/tankard.rb index c4ee3ae..ba7b049 100644 --- a/lib/tankard.rb +++ b/lib/tankard.rb @@ -25,5 +25,9 @@ def method_missing(method_name, *args, &block) return super unless client.respond_to?(method_name) client.send(method_name, *args, &block) end + + def reset_client + @client.value = nil + end end end diff --git a/lib/tankard/configuration.rb b/lib/tankard/configuration.rb index db4b729..8cb5411 100644 --- a/lib/tankard/configuration.rb +++ b/lib/tankard/configuration.rb @@ -13,8 +13,9 @@ def configure def reset! Tankard::Configuration::KEYS.each do |key| - instance_variable_set(:"@{key}", nil) + instance_variable_set(:"@#{key}", nil) end + reset_client end private @@ -30,5 +31,9 @@ def validate_api_key! raise Tankard::Error::ConfigurationError, "api_key is not a string" end end + + def reset_client + raise Tankard::Error::ConfigurationError, "Implement reset_client" + end end end \ No newline at end of file