Skip to content

Commit

Permalink
Fix reset! method in tankard configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshafer committed May 10, 2013
1 parent 75b07ac commit 18cc5de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/tankard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion lib/tankard/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 18cc5de

Please sign in to comment.