Sha256: 4a1bb7e47cb9c578f428a761800a140ffef3d4039d8bddb12f901823c466dc51

Contents?: true

Size: 956 Bytes

Versions: 2

Compression:

Stored size: 956 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'test_helper'

class TestDay < MiniTest::Unit::TestCase
  include WeatherReport

  def setup
    city_id = Weather.request_cityid("東京")
    uri = URI.parse("http://weather.livedoor.com/forecast/webservice/json/v1?city=#{city_id}")
    @forecasts = JSON.parse(uri.read)
    @day = Day.new(@forecasts, "明日")
  end

  def test_initialize
    assert_instance_of Day, Day.new(@forecasts, "明日")
  end

  def test_date
    assert_respond_to @day, :date
    assert_instance_of Date, @day.date
  end

  def test_telop
    assert_respond_to @day, :telop
  end

  def test_temperature_min
    assert_respond_to @day, :temperature_min
    assert_instance_of Fixnum, @day.temperature_min
  end

  def test_temperature_max
    assert_respond_to @day, :temperature_max
    assert_instance_of Fixnum, @day.temperature_max
  end

  def test_to_h
    assert_respond_to @day, :to_h
    puts @day.to_h
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weather-report-0.2.1 test/weather-report/test_day.rb
weather-report-0.2.0 test/weather-report/test_day.rb