endeca 1.3.7

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.
@@ -0,0 +1,50 @@
1
+ require File.join(File.dirname(__FILE__), %w[.. spec_helper])
2
+
3
+ describe Endeca::Transformer do
4
+ class Helper
5
+ extend Endeca::Transformer
6
+
7
+ inherited_accessor :mappings, {}
8
+ end
9
+
10
+ before do
11
+ @helper = Helper.new
12
+ end
13
+
14
+ it "should add the map method to the class" do
15
+ Helper.should respond_to(:map)
16
+ end
17
+
18
+ it "should add the tranform_query_options method to the class" do
19
+ Helper.should respond_to(:transform_query_options)
20
+ end
21
+
22
+ describe ".map" do
23
+ it "should raise Argument error for more than one key=>value pair" do
24
+ lambda{Helper.map({:foo => :bar, :bizz => :bazz})}.
25
+ should raise_error(ArgumentError, "map only accepts one key=>value pair")
26
+ end
27
+
28
+ it "should add Map object to mappings" do
29
+ Helper.map :foo => :bar
30
+ Helper.mappings[:foo].class.should == Endeca::Map
31
+ end
32
+
33
+ it "should add Map object to mappings with only one argument" do
34
+ Helper.map :foo
35
+ Helper.mappings[:foo].class.should == Endeca::Map
36
+ end
37
+
38
+ it "should create a boolean mapping" do
39
+ Helper.map(:foo => :bar).should be_boolean
40
+ end
41
+ end
42
+
43
+ describe ".transform_query_options" do
44
+ it "should return new query based on transformation" do
45
+ Helper.map :foo => :bar
46
+ expected_query = {:bar => :bazz}
47
+ Helper.transform_query_options(:foo => :bazz).should == expected_query
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,37 @@
1
+
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+
4
+ describe Endeca do
5
+ describe ".version" do
6
+ it "returns the version string" do
7
+ Endeca.version.should == Endeca::VERSION
8
+ end
9
+ end
10
+
11
+ describe "#escape" do
12
+ query = 'N=5875 5922&Nf=geocode|GCLT 26.121900,-80.143600 32.18688&Nu=mgtcoid&Ns=searchonly|0||isapartment|1||sortorder|0&Ntk=showapartment|mgtcologodisplay&F=cityseopath:1|mediummgtcologo:1|mgtcodescription:1|mgtcoid:1|mgtcologo:1|mgtcologodisplay:1|mgtconame:1|msa_code:1|propertycity:1|propertystatelong:1|smallmgtcologo:1|webtollfree:1|mvtphone:1&Ntt=1|1&M=recs_per_page:99999|expand_all_dims:0'
13
+
14
+ Endeca.escape(query).should == 'N=5875%205922&Nf=geocode%7CGCLT%2026.121900,-80.143600%2032.18688&Nu=mgtcoid&Ns=searchonly%7C0%7C%7Cisapartment%7C1%7C%7Csortorder%7C0&Ntk=showapartment%7Cmgtcologodisplay&F=cityseopath%3A1%7Cmediummgtcologo%3A1%7Cmgtcodescription%3A1%7Cmgtcoid%3A1%7Cmgtcologo%3A1%7Cmgtcologodisplay%3A1%7Cmgtconame%3A1%7Cmsa_code%3A1%7Cpropertycity%3A1%7Cpropertystatelong%3A1%7Csmallmgtcologo%3A1%7Cwebtollfree%3A1%7Cmvtphone%3A1&Ntt=1%7C1&M=recs_per_page%3A99999%7Cexpand_all_dims%3A0'
15
+
16
+ end
17
+
18
+ describe "#get_timer" do
19
+ it "without system_timer available returns Timeout" do
20
+ Endeca.should_receive(:require).
21
+ with('system_timer').and_raise(LoadError)
22
+ Endeca.should_receive(:require).
23
+ with('timeout').and_return(true)
24
+
25
+ Endeca.send(:get_timer).should == Timeout
26
+ end
27
+
28
+ it "will return SystemTimer if available" do
29
+ Endeca.should_receive(:require).
30
+ with('system_timer').and_return(true)
31
+
32
+ Endeca.send(:get_timer).should == SystemTimer
33
+ end
34
+ end
35
+ end
36
+
37
+ # EOF
@@ -0,0 +1,5 @@
1
+ --text-summary
2
+ --exclude
3
+ json,FakeWeb,rcov.rb,rspec,spec,activesupport,builder,gem
4
+ --sort
5
+ coverage
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format
3
+ progress
@@ -0,0 +1 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib endeca]))
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: endeca
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.7
5
+ platform: ruby
6
+ authors:
7
+ - Rein Henrichs
8
+ - Andy Stone
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-09-15 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: An Endeca client library for Ruby.
18
+ email: ""
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - History.txt
25
+ - Manifest.txt
26
+ - README.rdoc
27
+ files:
28
+ - History.txt
29
+ - Manifest.txt
30
+ - README.rdoc
31
+ - Rakefile
32
+ - endeca.gemspec
33
+ - example/benchmark.rb
34
+ - example/listing.rb
35
+ - lib/class_to_proc.rb
36
+ - lib/core_ext.rb
37
+ - lib/endeca.rb
38
+ - lib/endeca/benchmarking.rb
39
+ - lib/endeca/breadcrumb.rb
40
+ - lib/endeca/breadcrumbs.rb
41
+ - lib/endeca/dimension.rb
42
+ - lib/endeca/document.rb
43
+ - lib/endeca/document_collection.rb
44
+ - lib/endeca/logging.rb
45
+ - lib/endeca/map.rb
46
+ - lib/endeca/readers.rb
47
+ - lib/endeca/refinement.rb
48
+ - lib/endeca/refinement_dimension.rb
49
+ - lib/endeca/request.rb
50
+ - lib/endeca/transformer.rb
51
+ - spec/core_ext_spec.rb
52
+ - spec/endeca/benchmarking_spec.rb
53
+ - spec/endeca/breadcrumb_spec.rb
54
+ - spec/endeca/dimension_spec.rb
55
+ - spec/endeca/document_collection_spec.rb
56
+ - spec/endeca/document_spec.rb
57
+ - spec/endeca/map_spec.rb
58
+ - spec/endeca/readers_spec.rb
59
+ - spec/endeca/refinement_dimension_spec.rb
60
+ - spec/endeca/refinement_spec.rb
61
+ - spec/endeca/request_spec.rb
62
+ - spec/endeca/transformer_spec.rb
63
+ - spec/endeca_spec.rb
64
+ - spec/rcov.opts
65
+ - spec/spec.opts
66
+ - spec/spec_helper.rb
67
+ has_rdoc: true
68
+ homepage: http://github.com/primedia/endeca
69
+ licenses: []
70
+
71
+ post_install_message:
72
+ rdoc_options:
73
+ - --main
74
+ - README.rdoc
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
82
+ version:
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: "0"
88
+ version:
89
+ requirements: []
90
+
91
+ rubyforge_project: endeca
92
+ rubygems_version: 1.3.5
93
+ signing_key:
94
+ specification_version: 3
95
+ summary: An Endeca client library for Ruby
96
+ test_files: []
97
+