lib/soaspec.rb in soaspec-0.1.9 vs lib/soaspec.rb in soaspec-0.1.10
- old
+ new
@@ -8,10 +8,11 @@
require 'date'
require 'jsonpath'
require 'soaspec/version'
require 'soaspec/o_auth2'
+require 'soaspec/template_reader'
require 'soaspec/exchange_handlers/soap_handler'
require 'soaspec/exchange_handlers/exchange_handler'
require 'soaspec/exchange_handlers/rest_methods'
require 'soaspec/exchange'
require 'soaspec/matchers'
@@ -32,23 +33,29 @@
require 'soaspec/wsdl_generator'
# Gem for handling SOAP and REST api tests
module Soaspec
- @template_folder = 'template'
+ @template_folder = 'templates'
@auto_oauth = true
class << self
# Specify whether to see params sent to and retrieved from oauth. This will put password in log file, only recommended for debugging
attr_writer :debug_oauth
# Folder used to store templates for API calls
- attr_accessor :template_folder
+ attr_reader :template_folder
# Stores last exchange
attr_accessor :last_exchange
# Automatically add Authorization header to RestHandler where oauth2 credentials are specified
attr_accessor :auto_oauth
+ # Folder used to store templates for API calls
+ # Converts folder / folders into an array depending upon string passed
+ def template_folder=(folder)
+ @template_folder = folder.include?('\\') ? folder.split('\\') : folder.split('/')
+ end
+
# Folder used to store credentials
# Used in auth2_file command
# @param [String] folder
def credentials_folder=(folder)
@credentials_folder = folder
@@ -83,14 +90,9 @@
# @return [Boolean] Whether to see params sent to & received from oauth URL
def debug_oauth?
@debug_oauth || false
end
-
- # @return [String] Folder used to store templates for API calls
- # def template_folder
- # @template_folder || 'template'
- # end
# Whether to log all API traffic
def log_api_traffic=(set)
@log_api_traffic = set
RestClient.log = nil unless set