Sha256: c03426943b25431fad5d8b64857be7300bf7ff4e9e4b302e69bd82e851cea47f

Contents?: true

Size: 684 Bytes

Versions: 4

Compression:

Stored size: 684 Bytes

Contents

require 'helper'

describe WorldbankAsDataframe::Client do

  context 'get' do
    let(:query_string) { 'sources/all?format=json' }
    let(:client) { WorldbankAsDataframe::Client.new( { :dirs => ['sources', 'all'], :params => {:format => 'json'}}, false) }
    
    it 'returns the response from the specified path' do
      stub_get(query_string).to_return(:status => 200, :body => fixture('sources.json'))
      
      client.get(query_string)
      
      a_get(query_string).should have_been_made
    end
    
    it "returns null if status is not in 200s" do
      stub_get(query_string).to_return(:status => 500)
      client.get(query_string).should be_nil
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
worldbank_as_dataframe-0.2.1 spec/worldbank_as_dataframe/client_spec.rb
worldbank_as_dataframe-0.2 spec/worldbank_as_dataframe/client_spec.rb
worldbank_as_dataframe-0.1.1 spec/worldbank_as_dataframe/client_spec.rb
worldbank_as_dataframe-0.1.0 spec/worldbank_as_dataframe/client_spec.rb