Sha256: 32055b1f17c0f0b55899e8f8093a2acef28af9568707774425bed6857a945602

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Quandl::Format::Dataset do
  expected_errors = [
    { file: 'invalid_data',       error: /Date/ },
    { file: 'unknown_attribute',  error: /this_attribute_does_not_exist/ },
    { file: 'mismatched_columns', error: /Expected 4 but found 5/ },
    { file: 'mismatched_rows',    error: /Expected 3 but found 4/ },
    { file: 'invalid_yaml',       error: /could not find expected ':'/ },
    { file: 'missing_dashes',     error: /Attribute parse error at line 6 column 1/ },
    { file: 'missing_dashes',     error: /Did you forget to delimit the meta data section/ },
  ]
  # run each expectation
  expected_errors.each do |pair|
    it "#{pair[:file]}.qdf should error with #{pair[:error]}" do
      Quandl::Logger.should_receive(:error).at_least(:once).with(pair[:error])
      Quandl::Format::Dataset.load( fixtures_data[pair[:file]] )
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quandl_format-0.1.7 spec/lib/quandl/format/dataset/load/errors_spec.rb