lib/soaspec.rb in soaspec-0.0.38 vs lib/soaspec.rb in soaspec-0.0.39
- old
+ new
@@ -30,46 +30,79 @@
# @param [String] folder
def self.credentials_folder=(folder)
@credentials_folder = folder
end
- # Credentials folder used
+ # Credentials folder used to store secret data (not in source control) E.g passwords
def self.credentials_folder
@credentials_folder
end
+ # Used so that exchange class knows what context it's in
+ # @param [ExchangeHandler] handler A class inheriting from Soaspec::ExchangeHandler. Exchange class uses this
+ def self.api_handler=(handler)
+ @api_handler = handler
+ end
+
+ def self.api_handler
+ @api_handler
+ end
+
+ # Whether to transform strings to keys automatically
+ def self.always_use_keys=(use_keys)
+ @always_use_keys = use_keys
+ end
+
+ def self.always_use_keys?
+ @always_use_keys || true
+ end
+
+ # Whether to remove namespaces from response in Xpath assertion automatically
+ # For why this may not be a good thing in general see
+ # http://tenderlovemaking.com/2009/04/23/namespaces-in-xml.html
+ # This will be overridden if xpath has a ':' in it
+ def self.strip_namespaces=(remove_namespaces_from_response)
+ @strip_namespaces = remove_namespaces_from_response
+ end
+
+ # Whether to remove namespaces in xpath assertion automatically
+ def self.strip_namespaces?
+ @strip_namespaces || false
+ end
+
+ # -Deprecated- for favour of putting directly in Soaspec
# Represents Environment parameters used in Soaspec tests
module Environment
# Used so that exchange class knows what context it's in
def self.api_handler=(handler)
- @api_handler = handler
+ Soaspec.api_handler = handler
end
def self.api_handler
- @api_handler
+ Soaspec.api_handler
end
# Whether to transform strings to keys automatically
def self.always_use_keys=(use_keys)
- @always_use_keys = use_keys
+ Soaspec.always_use_keys = use_keys
end
def self.always_use_keys?
- @always_use_keys || true
+ Soaspec.always_use_keys? || true
end
# Whether to remove namespaces from response in Xpath assertion automatically
# For why this may not be a good thing in general see
# http://tenderlovemaking.com/2009/04/23/namespaces-in-xml.html
# This will be overridden if xpath has a ':' in it
def self.strip_namespaces=(remove_namespaces_from_response)
- @strip_namespaces = remove_namespaces_from_response
+ Soaspec.strip_namespaces = remove_namespaces_from_response
end
# Whether to remove namespaces in xpath assertion automatically
def self.strip_namespaces?
- @strip_namespaces || false
+ Soaspec.strip_namespaces? || false
end
end
# Contains commonly used REST methods