Sha256: c070dee947e5610ccedf07c230f02219b661980a0a4c546aeabb0cf7cc47c22b

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe 'GoogleTZ' do
  describe 'lookup' do
    it 'fetches timezone info for a given latitude, longitude' do
      resp = GoogleTZ.lookup(39.7392, -104.9847)

      resp.success?.should == true
      resp.status.should == 'OK'
      resp.dst_offset.should == 3600
      resp.raw_offset.should == -25200
      resp.timezone_id.should == "America/Denver"
      resp.timezone_name.should == "Mountain Daylight Time"
	end

	it 'fetches timezone info when given optional arguments' do
	  resp = GoogleTZ.lookup(39.7392, -104.9847, timestamp: 1377891332, sensor: false, language: "de")

      resp.success?.should == true
      resp.status.should == 'OK'
      resp.dst_offset.should == 3600
      resp.raw_offset.should == -25200
      resp.timezone_id.should == "America/Denver"
      resp.timezone_name.should == "Rocky Mountain Sommerzeit"
	end
  end
end



"{\n   \"dstOffset\" : 3600,\n   \"rawOffset\" : -25200,\n   \"status\" : \"OK\",\n   \"timeZoneId\" : \"America/Denver\",\n   \"timeZoneName\" : \"Hora de verano de MontaƱa\"\n}\n"
'{\n   \"dstOffset\" : 3600,\n   \"rawOffset\" : -25200,\n   \"status\" : \"OK\",\n   \"timeZoneId\" : \"America/Denver\",\n   \"timeZoneName\" : \"Hora de verano de Monta\\xC3\\xB1a\"\n}\n'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
google_tz-0.3.0 spec/lib/google_tz_spec.rb