Sha256: 033ea01fc81a4a2997e9f268369914a5298ae7ab4aaffc8e5b1319764e5c2e63

Contents?: true

Size: 900 Bytes

Versions: 2

Compression:

Stored size: 900 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe GoMaps::CEP do
  context 'given valid cep' do
    before :each do
      map_url_to_file 'http://www.bronzebusiness.com.br/webservices/wscep.asmx/cep?strcep=01310-000', 'cep_success'
      @cep = GoMaps::CEP.new('01310-000')
    end

    context 'on #street' do
      it 'should return the street' do
        @cep.street.should eql('Avenida Paulista')
      end
    end

    context 'on #city' do
      it 'should return the city' do
        @cep.city.should eql('Sao Paulo')
      end
    end
  end

  context 'given invalid cep' do
    it 'should raise AddressNotFoundException' do
      map_url_to_file 'http://www.bronzebusiness.com.br/webservices/wscep.asmx/cep?strcep=12345-678', 'cep_error'
      lambda { @cep = GoMaps::CEP.new('12345-678') }.should raise_error(GoMaps::AddressNotFoundException)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
go_maps-0.4 spec/go_maps/cep_spec.rb
go_maps-0.3.2 spec/go_maps/cep_spec.rb