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