Sha256: e5612af1b69ce3ebf2e62556dd463e0bff858409951317d8cea91e21df6afe07

Contents?: true

Size: 1.35 KB

Versions: 10

Compression:

Stored size: 1.35 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'

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

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

10 entries across 10 versions & 1 rubygems

Version Path
spark_api-1.3.16 spec/spec_helper.rb
spark_api-1.3.15 spec/spec_helper.rb
spark_api-1.3.14 spec/spec_helper.rb
spark_api-1.3.13 spec/spec_helper.rb
spark_api-1.3.10 spec/spec_helper.rb
spark_api-1.3.9 spec/spec_helper.rb
spark_api-1.3.6 spec/spec_helper.rb
spark_api-1.3.3 spec/spec_helper.rb
spark_api-1.3.1 spec/spec_helper.rb
spark_api-1.3.0 spec/spec_helper.rb