From ae7294bdfdec2134ae88413e49e693239df0dee9 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 23 Sep 2011 10:59:30 -0500 Subject: [PATCH] [rackspace|dns] fix mock init to play nice with tests --- lib/fog/rackspace/dns.rb | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/fog/rackspace/dns.rb b/lib/fog/rackspace/dns.rb index be6705d55..e81910b92 100644 --- a/lib/fog/rackspace/dns.rb +++ b/lib/fog/rackspace/dns.rb @@ -38,7 +38,32 @@ module Fog class Mock def initialize(options={}) - Fog::Mock.not_implemented + @rackspace_api_key = options[:rackspace_api_key] + @rackspace_username = options[:rackspace_username] + @rackspace_auth_url = options[:rackspace_auth_url] + @connection_options = options[:connection_options] || {} + end + + def self.data + @data ||= { + :zones => {} + } + end + + def self.reset + @data = nil + end + + def auth_token + @auth_token ||= Fog::Dynect::Mock.token + end + + def data + self.class.data + end + + def reset_data + self.class.reset end end