Sha256: e7afedc799a186e882c197a4557410c917783013eebe26c229c4bd80c3c9ed69

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

require 'forecast'
describe Forecast do
  
  def dump_forecast(forecast)
    if forecast != nil
      puts forecast.date.strftime("%F %T") + " | " + forecast.temp.to_s + " | " + forecast.condition + " | " + forecast.icon
    else
      puts 'nil'
    end
  end
  
  # it "current" do 
    # puts "*** CURRENT ***"
    # forecast = Forecast.current(54.9999, 9.534)
    # dump_forecast(forecast)
    # expect(forecast).not_to be_nil
  # end
  # it "hourly" do 
    # puts "*** HOURLY FORECASTS ***"
    # forecasts = Forecast.hourly(54.9999, 9.534)
    # forecasts.each do |forecast|
      # dump_forecast(forecast)
    # end
    # expect(forecasts.size).to be >= 1
  # end
  # it "daily" do 
    # puts "*** DAILY FORECASTS ***"
    # forecasts = Forecast.daily(54.9999, 9.534)
    # forecasts.each do |forecast|
      # #puts forecast.date.strftime("%F %T") + " | " + forecast.temp_min.to_s + " | " + forecast.temp_max.to_s + " | " + forecast.condition + " | " + forecast.icon
      # dump_forecast(forecast)
    # end
    # expect(forecasts.size).to be >= 1
  # end
  it "select_date" do 
    puts "*** SELECT FORECAST ***"
    forecast = Forecast.daily(54.9999, 9.534).select_date(Time.now + (24*60*60) * 2)
    dump_forecast(forecast)
    expect(forecast).not_to be_nil
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
forecast-0.0.7 spec/forecast_spec.rb
forecast-0.0.6 spec/forecast_spec.rb
forecast-0.0.5 spec/forecast_spec.rb
forecast-0.0.4 spec/forecast_spec.rb
forecast-0.0.3 spec/forecast_spec.rb
forecast-0.0.2 spec/forecast_spec.rb