Sha256: e9aa8b49454a6d7a4611654c1f2fceb8e3ff7e6f6688c08c3e58bfa2a49e3582

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

require_relative '../../spec_helper'

module Barometer::WeatherService
  describe WundergroundV1::CurrentResponse do
    it 'parses the timezones correctly' do
      payload = Barometer::Utils::Payload.new({
        'local_time' => 'May 18, 10:46 AM PDT'
      })
      response = WundergroundV1::CurrentResponse.new.parse(payload)

      current_year = Time.now.year
      utc_observed_at = Time.utc(current_year,5,18,17,46,0)
      utc_stale_at = Time.utc(current_year,5,18,18,0,0)

      expect( response.current.observed_at.utc ).to eq utc_observed_at
      expect( response.current.stale_at.utc ).to eq utc_stale_at
      expect( response.timezone.to_s ).to eq 'PDT'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
barometer-0.9.7 spec/weather_services/wunderground_v1/current_response_spec.rb
barometer-0.9.6 spec/weather_services/wunderground_v1/current_response_spec.rb
barometer-0.9.5 spec/weather_services/wunderground_v1/current_response_spec.rb