Sha256: f046f51b003840ae819460870f9f0cf359ebd386df5d199ad09a162835514536

Contents?: true

Size: 1.26 KB

Versions: 7

Compression:

Stored size: 1.26 KB

Contents

require "rubygems"

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

path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
require path + '/spark_api'

require 'spark_api'

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

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")

include SparkApi::Models

def reset_config
  SparkApi.reset
  SparkApi.configure { |c| c.api_user = "foobar" }
end

# Requires supporting ruby files with custom matchers and macros, etc,
# # in spec/support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}

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'
  config.before(:all) { reset_config }
end

def jruby? 
  RUBY_PLATFORM == "java"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spark_api-1.3.24 spec/spec_helper.rb
spark_api-1.3.23 spec/spec_helper.rb
spark_api-1.3.21 spec/spec_helper.rb
spark_api-1.3.20 spec/spec_helper.rb
spark_api-1.3.19 spec/spec_helper.rb
spark_api-1.3.18 spec/spec_helper.rb
spark_api-1.3.17 spec/spec_helper.rb