Sha256: 10f7dc86e53c8a95505367803b9e00685f2405e96e22b4675dd6a42dd038d22b

Contents?: true

Size: 931 Bytes

Versions: 8

Compression:

Stored size: 931 Bytes

Contents

require 'spec/spec_helper'
require 'examples/current_weather'

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

  it "should extract observations" do
    @weather.observation.should 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
    @observation.temperature.should > 0
  end

  it "should extract feels_like" do
    @observation.feels_like.should > 0
  end

  describe "#current_condition" do
    it "should extract current_condition" do
      @observation.current_condition.should_not be_empty
    end

    it "should extract icon attribute" do
      pending "need to think options through for HappyMapper-style :attributes extensions"
      @observation.current_condition.icon.should_not be_empty
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
yob-roxml-3.1.6 spec/examples/current_weather_spec.rb
roxml-3.1.5 spec/examples/current_weather_spec.rb
roxml-3.1.4 spec/examples/current_weather_spec.rb
roxml-3.1.3 spec/examples/current_weather_spec.rb
roxml-3.1.2 spec/examples/current_weather_spec.rb
roxml-3.1.1 spec/examples/current_weather_spec.rb
roxml-3.1.0 spec/examples/current_weather_spec.rb
ROXML-3.0.0 spec/examples/current_weather_spec.rb