Sha256: 9c079469d2f6d9e218d2068f86ea8cc7dccefc8a4444bf143e9ca2d03cd7828d
Contents?: true
Size: 1.45 KB
Versions: 5
Compression:
Stored size: 1.45 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Quandl::Command::Tasks::Download do def self.it_should_download(code, options={}) it "should download #{code}, #{options}" do Quandl::Logger.should_receive(:info).with(/code: #{code}/) Quandl::Command::Tasks::Download.call( code, options ) end end context "spec/fixtures/data/datasets.qdf" do before(:all){ Quandl::Command::Tasks::Upload.call( 'spec/fixtures/data/datasets.qdf' ) } it_should_download 'TEST_1' it_should_download 'TEST_2' it_should_download 'TEST_4', column: 2 it_should_download 'TEST_4', order: 'asc' it_should_download 'TEST_4', order: 'desc' it_should_download 'TEST_4', limit: 10 it_should_download 'TEST_4', row: 10 it_should_download 'TEST_4', offset: 10 # test each transformation Quandl::Operation::Transform.valid_transformations.each{|v| it_should_download('TEST_4', transformation: v.to_s ) } # test each collapse Quandl::Operation::Collapse.valid_collapses.each{|v| it_should_download('TEST_4', collapse: v.to_s ) } after(:all){ Quandl::Format::Dataset.load_from_file('spec/fixtures/data/datasets.qdf').each{|d| Quandl::Command::Tasks::Delete.call( d.code, force_yes: true ) } } end it "should not download TEST_DOES_NOT_EXIST." do Quandl::Logger.should_receive(:error).with(/Not Found/) Quandl::Command::Tasks::Download.call( 'TEST_DOES_NOT_EXIST' ) end end
Version data entries
5 entries across 5 versions & 1 rubygems