fandango 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,8 @@ module Fandango
22
22
  private
23
23
 
24
24
  def fetch_and_parse(postal_code)
25
- feed = Feedzirra::Feed.fetch_and_parse("http://www.fandango.com/rss/moviesnearme_#{postal_code}.rss")
25
+ cleaned_postal_code = postal_code.to_s.gsub(' ', '')
26
+ feed = Feedzirra::Feed.fetch_and_parse("http://www.fandango.com/rss/moviesnearme_#{cleaned_postal_code}.rss")
26
27
  raise BadResponse.new(feed) unless feed.respond_to?(:entries)
27
28
  feed
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module Fandango
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -30,6 +30,14 @@ describe Fandango do
30
30
  proc { Fandango.movies_near(123) }.must_raise(Fandango::BadResponse)
31
31
  end
32
32
 
33
+ it 'removes spaces from postal code' do
34
+ feed = Object.new
35
+ feed.stubs(:entries).returns([])
36
+ url = 'http://www.fandango.com/rss/moviesnearme_ABC123.rss'
37
+ Feedzirra::Feed.expects(:fetch_and_parse).with(url).returns(feed)
38
+ Fandango.send(:fetch_and_parse, 'ABC 123')
39
+ end
40
+
33
41
  end
34
42
 
35
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fandango
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-13 00:00:00.000000000Z
12
+ date: 2012-05-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70103962735000 !ruby/object:Gem::Requirement
16
+ requirement: &70174952184240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 3.2.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *70103962735000
27
+ version_requirements: *70174952184240
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: nokogiri
30
- requirement: &70103962734200 !ruby/object:Gem::Requirement
30
+ requirement: &70174952183440 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: 1.4.4
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *70103962734200
38
+ version_requirements: *70174952183440
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: sax-machine
41
- requirement: &70103962733680 !ruby/object:Gem::Requirement
41
+ requirement: &70174952182680 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 0.1.0
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *70103962733680
49
+ version_requirements: *70174952182680
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: curb
52
- requirement: &70103962733100 !ruby/object:Gem::Requirement
52
+ requirement: &70174952181900 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ~>
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: 0.7.15
58
58
  type: :runtime
59
59
  prerelease: false
60
- version_requirements: *70103962733100
60
+ version_requirements: *70174952181900
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: builder
63
- requirement: &70103962732520 !ruby/object:Gem::Requirement
63
+ requirement: &70174952181420 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ! '>='
@@ -68,10 +68,10 @@ dependencies:
68
68
  version: 2.1.2
69
69
  type: :runtime
70
70
  prerelease: false
71
- version_requirements: *70103962732520
71
+ version_requirements: *70174952181420
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: loofah
74
- requirement: &70103962731780 !ruby/object:Gem::Requirement
74
+ requirement: &70174952180940 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
77
  - - ~>
@@ -79,10 +79,10 @@ dependencies:
79
79
  version: 1.2.0
80
80
  type: :runtime
81
81
  prerelease: false
82
- version_requirements: *70103962731780
82
+ version_requirements: *70174952180940
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rdoc
85
- requirement: &70103962730900 !ruby/object:Gem::Requirement
85
+ requirement: &70174952180240 !ruby/object:Gem::Requirement
86
86
  none: false
87
87
  requirements:
88
88
  - - ~>
@@ -90,10 +90,10 @@ dependencies:
90
90
  version: '3.8'
91
91
  type: :runtime
92
92
  prerelease: false
93
- version_requirements: *70103962730900
93
+ version_requirements: *70174952180240
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: rake
96
- requirement: &70103962730420 !ruby/object:Gem::Requirement
96
+ requirement: &70174952179760 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
99
  - - ! '>='
@@ -101,10 +101,10 @@ dependencies:
101
101
  version: 0.8.7
102
102
  type: :runtime
103
103
  prerelease: false
104
- version_requirements: *70103962730420
104
+ version_requirements: *70174952179760
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: i18n
107
- requirement: &70103962729760 !ruby/object:Gem::Requirement
107
+ requirement: &70174952179220 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
110
  - - ! '>='
@@ -112,10 +112,10 @@ dependencies:
112
112
  version: 0.5.0
113
113
  type: :runtime
114
114
  prerelease: false
115
- version_requirements: *70103962729760
115
+ version_requirements: *70174952179220
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: awesome_print
118
- requirement: &70103962729220 !ruby/object:Gem::Requirement
118
+ requirement: &70174952178660 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
121
  - - ! '>='
@@ -123,10 +123,10 @@ dependencies:
123
123
  version: '0'
124
124
  type: :development
125
125
  prerelease: false
126
- version_requirements: *70103962729220
126
+ version_requirements: *70174952178660
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: mocha
129
- requirement: &70103962728400 !ruby/object:Gem::Requirement
129
+ requirement: &70174952177840 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - =
@@ -134,10 +134,10 @@ dependencies:
134
134
  version: 0.10.3
135
135
  type: :development
136
136
  prerelease: false
137
- version_requirements: *70103962728400
137
+ version_requirements: *70174952177840
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: minitest
140
- requirement: &70103962727760 !ruby/object:Gem::Requirement
140
+ requirement: &70174952177100 !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
143
143
  - - =
@@ -145,7 +145,7 @@ dependencies:
145
145
  version: 2.11.1
146
146
  type: :development
147
147
  prerelease: false
148
- version_requirements: *70103962727760
148
+ version_requirements: *70174952177100
149
149
  description: Find theaters and movies on sale near a given postal code
150
150
  email:
151
151
  - jared@redningja.com