RuBing 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/rubing.rb +6 -6
  2. data/test/test_search.rb +3 -1
  3. metadata +3 -3
@@ -157,15 +157,15 @@ module RuBing
157
157
  puts "Bad Key: '#{key}' #{e.message}"
158
158
  puts result_hash.inspect
159
159
  end
160
-
161
- # So in some unknown situations Bing does not return some attributes!
162
- def method_missing(method_name, *args, &block)
163
- return "" if REQUIRED_ATTRIBUTES.include?(method_name)
164
- raise NoMethodError
165
- end
166
160
  end
167
161
  end
168
162
 
163
+ # So in some unknown situations Bing does not return some attributes!
164
+ def method_missing(method_name, *args, &block)
165
+ return "" if REQUIRED_ATTRIBUTES.include?(method_name.to_s)
166
+ raise NoMethodError
167
+ end
168
+
169
169
  def data
170
170
  @data
171
171
  end
@@ -18,6 +18,8 @@ class SearchTest < Test::Unit::TestCase
18
18
 
19
19
  def test_result_structure
20
20
  response = RuBing::Search.get('Ruby')
21
- assert response.results.first.methods.include?('url')
21
+ RuBing::Result::REQUIRED_ATTRIBUTES.each do |attrib|
22
+ assert response.results.first.respond_to?(attrib.to_sym), "Missing required attribute #{attrib}.}"
23
+ end
22
24
  end
23
25
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Wesley Moxam
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-09 00:00:00 -05:00
17
+ date: 2010-12-13 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency