Sha256: 0e8cc5622ad43ec4435cdefeacf9b6317913e638d73181198c7edab3eccbec6f

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

require "rubygems"
require "json"
require 'multi_json'
require "rspec"
require 'rspec/autorun'
require 'webmock/rspec'

begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
require path + '/spark_api'

require 'spark_api'
require File.expand_path('../mock_helper', __FILE__)
require File.expand_path('../json_helper', __FILE__)
require File.expand_path('../json_hash_test_support', __FILE__)


FileUtils.mkdir 'log' unless File.exists? 'log'

# TODO, really we should change the library to support configuration without overriding
module SparkApi
  def self.logger
    if @logger.nil?
      @logger = Logger.new('log/test.log')
      @logger.level = Logger::DEBUG
    end
    @logger
  end
end

SparkApi.logger.info("Setup gem for rspec testing")

def reset_config()
  SparkApi.reset
  SparkApi.configure do |config|
    config.api_user = "foobar"
  end
end
reset_config

include SparkApi::Models

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.alias_example_to :on_get_it, :method => 'GET'
  config.alias_example_to :on_put_it, :method => 'PUT'
  config.alias_example_to :on_post_it, :method => 'POST'
  config.alias_example_to :on_delete_it, :method => 'DELETE'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spark_api-1.1.1 spec/spec_helper.rb