weatherzone 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/weatherzone.rb CHANGED
@@ -35,5 +35,5 @@ require 'weatherzone/helpers/date_parser'
35
35
  require 'weatherzone/helpers/units'
36
36
 
37
37
  module Weatherzone
38
- VERSION = '0.6.0'
38
+ VERSION = '0.6.1'
39
39
  end
@@ -36,6 +36,10 @@ module Weatherzone
36
36
  @@connection = Weatherzone::Connection.instance
37
37
 
38
38
  class << self
39
+ def parse_file(file_name)
40
+ parse(File.open(file_name))
41
+ end
42
+
39
43
  def find(options, location_code=nil)
40
44
  set_options(options)
41
45
  make_request(build_params(location_code, options))
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestFileParser < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @weather = Weather.parse_file("test/response/everything.xml")
7
+ end
8
+
9
+ def test_should_be_an_instance_of_weather
10
+ assert_kind_of Weather, @weather
11
+ end
12
+
13
+ def test_should_have_countries
14
+ assert @weather.countries.any?
15
+ end
16
+
17
+ def test_countries_should_be_countries
18
+ assert_kind_of Country, @weather.countries.first
19
+ end
20
+
21
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
8
+ - 1
9
+ version: 0.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Askins
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-17 00:00:00 +11:00
17
+ date: 2010-03-19 00:00:00 +11:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +27,8 @@ dependencies:
27
27
  segments:
28
28
  - 1
29
29
  - 8
30
- - 2
31
- version: 1.8.2
30
+ - 0
31
+ version: 1.8.0
32
32
  type: :development
33
33
  version_requirements: *id001
34
34
  description: Ruby client for the weatherzone webservice.
@@ -138,6 +138,7 @@ test_files:
138
138
  - test/test_daily_observation.rb
139
139
  - test/test_district_forecast.rb
140
140
  - test/test_farenheit_conversion_factor.rb
141
+ - test/test_file_parser.rb
141
142
  - test/test_finder.rb
142
143
  - test/test_forecast.rb
143
144
  - test/test_helper.rb