File: current_weather_spec.rb

package info (click to toggle)
ruby-roxml 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 800 kB
  • sloc: ruby: 4,133; xml: 1,013; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'spec_helper'
require_relative './../../examples/current_weather'

describe Weather do
  before do
    @weather = Weather.from_xml(xml_for('current_weather'))
  end

  it "should extract observations" do
    expect(@weather.observation).to be_an_instance_of(WeatherObservation)
  end
end

describe WeatherObservation do
  before do
    @observation = Weather.from_xml(xml_for('current_weather')).observation
  end

  it "should extract temperature" do
    expect(@observation.temperature).to be > 0
  end

  it "should extract feels_like" do
    expect(@observation.feels_like).to be > 0
  end

  describe "#current_condition" do
    it "should extract current_condition" do
      expect(@observation.current_condition).to_not be_empty
    end

    it "should extract icon attribute" do
      skip "need to think options through for HappyMapper-style :attributes extensions"
      expect(@observation.current_condition.icon).to_not be_empty
    end
  end
end