Sha256: 6c96982c8c3cb2dde6e716c9e83b63e78a37f8c2efbce32704ff4d8c414afc32

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
 
ENV['QUANDL_TOKEN'] = ENV['QUANDL_TEST_TOKEN']
ENV['QUANDL_URL'] = ENV['QUANDL_TEST_URL']

require "rspec"
require 'factory_girl'
require 'pry'
require 'commander'
require 'quandl/command'
require 'open3'

# disable log output
class TestOutput
  
  class << self
    def info(*args)
      puts(*args)
    end
    def fatal(*args)
      puts(*args)
    end
    def error(*args)
      puts(*args)
    end
    def debug(*args)
      puts(*args)
    end
  end
  
end
Quandl::Logger.use(TestOutput)

factory_dir = File.join( File.dirname(__FILE__), 'factories/**/*.rb' )
Dir.glob( factory_dir ).each{|f| require(f); puts f }

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
end

def quandl(statement)
  version = "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
  path = File.join(Quandl::Command::Tasks.root, 'bin/quandl')
  command = "bundle exec #{path} #{statement} --token #{ENV['QUANDL_TEST_TOKEN']} --url #{ENV['QUANDL_TEST_URL']}  --force-yes --trace"
  stdin, stdout, stderr = Open3.popen3(command)
  OpenStruct.new( stderr: stderr.read, stdout: stdout.read )
end

def data_path(path)
  File.join("spec/fixtures/data/", path)
end

def error_path(path)
  File.join("spec/fixtures/data/errors/", path)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
quandl-0.3.7 spec/spec_helper.rb
quandl-0.3.6 spec/spec_helper.rb
quandl-0.3.4 spec/spec_helper.rb
quandl-0.3.3 spec/spec_helper.rb
quandl-0.3.0 spec/spec_helper.rb