Sha256: d9446c761a990c5d0ab63ed916d25d02fa0cb3787ff0902c13b4383ec1d53b74

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Quandl::Format::Dataset::Load do
  
  let(:format){ qdf_format }
  
  describe "junk" do
    let(:collection){ Quandl::Format::Dataset::Load.string('asdf') }
    subject{ collection }
    its(:count){ should eq 0 }
  end
  
  describe ".file" do
    subject{ Quandl::Format::Dataset::Load.file("spec/fixtures/data/valid.qdf") }
    its(:count){ should eq 3 }
  end
  
  describe ".string" do
    
    let(:collection){ Quandl::Format::Dataset::Load.string(format) }
    subject{ collection }
    
    its(:count){ should eq 2 }
    
    describe "#first" do
      subject{ collection.first }

      it{ should be_a Quandl::Format::Dataset }
      its(:source_code){ should eq 'NSE' }
      its(:code){ should eq 'OIL' }
      its(:name){ should eq 'Oil India Limited' }
      its(:description){ should eq "Here is a description with multiple lines.\nThis is the second line." }
      its(:column_names){ should eq ['Date', 'Value', 'High', 'Low'] }
      its(:data){ should eq Quandl::Data.new([["2013-11-20", "9.99", "11.0", "14.0"],["2013-11-19", "10.03", nil, "14.09"]]) }
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quandl_format-0.2.8 spec/lib/quandl/format/dataset/load_spec.rb
quandl_format-0.2.7 spec/lib/quandl/format/dataset/load_spec.rb