primedia-endeca 0.9.10 → 0.9.11

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.
data/endeca.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{endeca}
5
- s.version = "0.9.10"
5
+ s.version = "0.9.11"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Rein Henrichs", "Andy Stone"]
@@ -105,12 +105,16 @@ module Endeca
105
105
  private
106
106
 
107
107
  def self.request(query_options)
108
+ Endeca::Request.perform(get_path, parse_query_options(query_options))
109
+ end
110
+
111
+ def self.parse_query_options(query_options)
108
112
  if query_options.respond_to?(:merge)
109
113
  new_query_options = get_default_params.merge(query_options)
110
114
  query_options = transform_query_options(new_query_options)
115
+ else
116
+ query_options
111
117
  end
112
-
113
- Endeca::Request.perform(get_path, query_options)
114
118
  end
115
119
  end
116
120
  end
data/lib/endeca.rb CHANGED
@@ -20,7 +20,7 @@ require 'endeca/document'
20
20
  module Endeca
21
21
 
22
22
  # :stopdoc:
23
- VERSION = '0.9.10'
23
+ VERSION = '0.9.11'
24
24
  # :startdoc:
25
25
 
26
26
  # Returns the version string for the library.
@@ -205,6 +205,23 @@ describe Endeca::Document do
205
205
  end
206
206
  end
207
207
 
208
+ describe ".all" do
209
+ describe "with a query string" do
210
+ it 'should make a request with the query string' do
211
+ Endeca::Request.should_receive(:perform).with(anything, "query string")
212
+ Endeca::Document.all("query string")
213
+ end
214
+
215
+ describe "and default parameters" do
216
+ it "should make a request with the query string and ignore the defaults" do
217
+ Endeca::Document.default_params :foo => :bar
218
+ Endeca::Request.should_receive(:perform).with(anything, "query string")
219
+ Endeca::Document.all("query string")
220
+ end
221
+ end
222
+ end
223
+ end
224
+
208
225
  describe ".transform_query_options" do
209
226
  before do
210
227
  @query_options = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primedia-endeca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rein Henrichs