rsolr 1.0.0.beta2 → 1.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.beta2
1
+ 1.0.0.beta3
@@ -51,9 +51,11 @@ module RSolr::Connectable
51
51
  # :path
52
52
  # :query
53
53
  def build_request path, opts
54
+ raise "path must be a string or symbol, not #{path.inspect}" unless [String,Symbol].include?(path.class)
55
+ path = path.to_s
54
56
  opts[:method] ||= :get
55
57
  raise "The :data option can only be used if :method => :post" if opts[:method] != :post and opts[:data]
56
- opts[:params] = opts[:params].nil? ? {:wt => :ruby} : opts[:params].merge(:wt => :ruby)
58
+ opts[:params] = opts[:params].nil? ? {:wt => :ruby} : {:wt => :ruby}.merge(opts[:params])
57
59
  query = RSolr::Uri.params_to_solr(opts[:params]) unless opts[:params].empty?
58
60
  opts[:query] = query
59
61
  if opts[:data].is_a? Hash
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+ describe "RSolr::Error" do
3
+
4
+ end
@@ -1,5 +1,20 @@
1
1
  require 'spec_helper'
2
2
  describe "RSolr::Http" do
3
+ it "Should be an RSolr::Connectable and implement an execute method" do
4
+ http = RSolr::Http.new
5
+ http.should be_a(RSolr::Connectable)
6
+ http.should respond_to(:execute)
7
+ end
8
+
9
+ context "execute" do
10
+ it "should require a request_context hash" do
11
+ http = RSolr::Http.new
12
+ lambda {
13
+ http.execute
14
+ }.should raise_error(ArgumentError)
15
+ end
16
+ end
17
+
3
18
  # it "should raise an Http error if the response status code aint right" do
4
19
  # client.connection.should_receive(:get).
5
20
  # and_return({:status => 400, :body => "", :headers => {}})
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 1
7
7
  - 0
8
8
  - 0
9
- - beta2
10
- version: 1.0.0.beta2
9
+ - beta3
10
+ version: 1.0.0.beta3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Mitchell
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-12 00:00:00 -04:00
18
+ date: 2010-08-18 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -89,6 +89,7 @@ test_files:
89
89
  - spec/api/char_spec.rb
90
90
  - spec/api/client_spec.rb
91
91
  - spec/api/connectable_spec.rb
92
+ - spec/api/error_spec.rb
92
93
  - spec/api/http_spec.rb
93
94
  - spec/api/uri_spec.rb
94
95
  - spec/api/xml_spec.rb