module Soaspec

Gem for handling SOAP and REST api tests

Constants

VERSION

@return [String] Version of the gem

Attributes

always_use_keys[W]

Set whether to transform strings to keys in request automatically. @return [Boolean]

api_handler[W]

Used so that exchange class knows what context it's in. @return [ExchangeHandler] handler A class inheriting from Soaspec::ExchangeHandler. Exchange class uses this

auto_oauth[RW]

Automatically add Authorization header to RestHandler where oauth2 credentials are specified @return [Boolean] Whether to add authorization header

credentials_folder[RW]

Credentials folder used to store secret data (not in source control) E.g passwords Used in oauth2_file command @return [String] Folder in which credentials are stored

last_exchange[RW]

Stores last exchange @return [Exchange]

log_warnings[RW]

@return [Boolean] Whether to log warnings such as methods that may change usage in the future

template_folder[R]

Folder used to store templates for API calls @return [String]

Public Class Methods

always_use_keys?() click to toggle source

@return [Boolean] Whether to transform strings to keys in request automatically

# File lib/soaspec.rb, line 87
def always_use_keys?
  @always_use_keys || true
end
api_handler() click to toggle source

@return [ExchangeHandler] handler A class inheriting from Soaspec::ExchangeHandler. Exchange class uses this

# File lib/soaspec.rb, line 71
def api_handler
  unless @api_handler
    raise Soaspec::Error, '@exchange_handler not set. ' \
    'Set either with `Soaspec.api_handler = Handler.new` or within the exchange'
  end
  @api_handler
end
debug_oauth=(set) click to toggle source

Specify whether to see params sent to and retrieved from oauth. This will put password in log file, only recommended for debugging @param [String] set Whether to debug oauth

# File lib/soaspec.rb, line 100
def debug_oauth=(set)
  puts 'Soaspec.debug_oauth= now deprecated. Please use Soaspec::OAuth2.debug_oauth= instead'
  Soaspec::OAuth2.debug_oauth = set
end
debug_oauth?() click to toggle source

@return [Boolean] Whether to see params sent to & received from oauth URL

# File lib/soaspec.rb, line 92
def debug_oauth?
  puts 'Soaspec.debug_oauth? now deprecated. Please use Soaspec::OAuth2.debug_oauth? instead'
  Soaspec::OAuth2.debug_oauth?
end
log_api_traffic=(set) click to toggle source

Whether to log all API traffic @param [Boolean] set

# File lib/soaspec.rb, line 107
def log_api_traffic=(set)
  puts 'Soaspec.log_api_traffic= now deprecated. Please use Soaspec::SpecLogger.log_api_traffic= instead'
  Soaspec::SpecLogger.log_api_traffic = set
end
log_api_traffic?() click to toggle source

@return [Boolean] Whether to log all API traffic

# File lib/soaspec.rb, line 113
def log_api_traffic?
  puts 'Soaspec.log_api_traffic? now deprecated. Please use Soaspec::SpecLogger.log_api_traffic? instead'
  Soaspec::SpecLogger.log_api_traffic?
end
template_folder=(folder) click to toggle source

Folder used to store templates for API calls Converts folder / folders into an array depending upon string passed

# File lib/soaspec.rb, line 57
def template_folder=(folder)
  @template_folder = folder.include?('\\') ? folder.split('\\') : folder.split('/')
end