Sha256: fe894d4a86952c233e7919a1946b6e35096d97df73d4a2cae145c2c9c4ec2919

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'mechanize'
require "yahoo-weather"
require 'weather_in_poland'

class TestAPI < Test::Unit::TestCase

  def setup
    @weather = WeatherInPoland.new
  end

  #check code and city, images, and getting data
  def test_all
    location = 'Pomorskie, Gdynia'
    correct_city = 'Gdynia'
    correct_code = 493421

    response = @weather.find_city(location)
    assert(response)
    assert_equal(correct_city, @weather.city)
    assert_equal(correct_code, @weather.code)
    
    @data = @weather.get_weather(@weather.code)
    assert_not_nil(@data)
    
    assert_not_nil(@data.condition.code)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
weather_in_poland-0.0.4 test/test.rb