Sha256: 0f85dcf8e611b2e47914746b49fb6f69f3ed51dda76372365e6fa9d8db623133

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Quandl::Operation::Parse do
  subject{ Quandl::Operation::Parse }
  let(:csv_data){ "#{Date.today}, 1.0, 2.0" }
  let(:hash_data){ { Date.today.to_s => [ 1.0, 2.0 ] } }
  let(:array_data){ [[ Date.today.to_s, 1.0, 2.0 ]] }
  let(:julian_data){ [[ Date.today.jd, 1.0, 2.0 ]] }
  
  it "#hash outputs array" do
    subject.hash( hash_data ).should eq array_data
  end
  
  it "#csv outputs array" do
    subject.csv( csv_data ).should eq array_data
  end
  
  describe "#perform" do
    it "should handle csv_data" do
      subject.perform( csv_data ).should eq julian_data
    end
    it "should handle julian_data" do
      subject.perform( julian_data ).should eq julian_data
    end
    it "should handle hash_data" do
      subject.perform( hash_data ).should eq julian_data
    end
    it "should handle array_data" do
      subject.perform( array_data ).should eq julian_data
    end
  end
  
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quandl_operation-0.1.10 spec/lib/quandl/operation/parse_spec.rb