thinking-sphinx 1.4.14 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/features/attribute_updates.feature +15 -13
  2. data/features/deleting_instances.feature +16 -13
  3. data/features/handling_edits.feature +20 -17
  4. data/features/searching_by_index.feature +6 -5
  5. data/features/step_definitions/common_steps.rb +8 -4
  6. data/features/support/env.rb +0 -3
  7. data/lib/thinking_sphinx.rb +8 -1
  8. data/lib/thinking_sphinx/active_record.rb +3 -3
  9. data/lib/thinking_sphinx/active_record/attribute_updates.rb +5 -4
  10. data/lib/thinking_sphinx/adapters/abstract_adapter.rb +7 -0
  11. data/lib/thinking_sphinx/auto_version.rb +1 -1
  12. data/lib/thinking_sphinx/bundled_search.rb +6 -10
  13. data/lib/thinking_sphinx/configuration.rb +19 -33
  14. data/lib/thinking_sphinx/connection.rb +71 -0
  15. data/lib/thinking_sphinx/deltas.rb +2 -0
  16. data/lib/thinking_sphinx/deltas/default_delta.rb +14 -18
  17. data/lib/thinking_sphinx/deltas/delete_job.rb +16 -0
  18. data/lib/thinking_sphinx/deltas/index_job.rb +17 -0
  19. data/lib/thinking_sphinx/search.rb +26 -14
  20. data/lib/thinking_sphinx/tasks.rb +1 -5
  21. data/spec/spec_helper.rb +0 -3
  22. data/spec/thinking_sphinx/active_record/delta_spec.rb +6 -5
  23. data/spec/thinking_sphinx/active_record/scopes_spec.rb +2 -1
  24. data/spec/thinking_sphinx/active_record_spec.rb +2 -2
  25. data/spec/thinking_sphinx/adapters/abstract_adapter_spec.rb +18 -0
  26. data/spec/thinking_sphinx/configuration_spec.rb +0 -68
  27. data/spec/thinking_sphinx/connection_spec.rb +77 -0
  28. data/spec/thinking_sphinx/facet_search_spec.rb +25 -25
  29. data/spec/thinking_sphinx/search_methods_spec.rb +34 -34
  30. data/spec/thinking_sphinx/search_spec.rb +4 -16
  31. metadata +48 -39
  32. data/lib/thinking_sphinx/version.rb +0 -3
  33. data/rails/init.rb +0 -16
  34. data/tasks/rails.rake +0 -1
@@ -1,7 +1,4 @@
1
1
  $:.unshift File.dirname(__FILE__) + '/../lib'
2
- Dir[File.join(File.dirname(__FILE__), '../vendor/*/lib')].each do |path|
3
- $:.unshift path
4
- end
5
2
 
6
3
  require 'rubygems'
7
4
  require 'fileutils'
@@ -65,12 +65,15 @@ describe "ThinkingSphinx::ActiveRecord::Delta" do
65
65
  end
66
66
 
67
67
  describe "index_delta method" do
68
+ let(:index_job) { double :perform => true }
69
+
68
70
  before :each do
69
71
  ThinkingSphinx::Configuration.stub!(:environment => "spec")
70
72
  ThinkingSphinx.deltas_enabled = true
71
73
  ThinkingSphinx.updates_enabled = true
72
74
  ThinkingSphinx.stub!(:sphinx_running? => true)
73
75
  Person.delta_objects.first.stub!(:` => "", :toggled => true)
76
+ ThinkingSphinx::Deltas::IndexJob.stub :new => index_job
74
77
 
75
78
  @person = Person.new
76
79
  Person.stub!(:search_for_id => false)
@@ -78,7 +81,7 @@ describe "ThinkingSphinx::ActiveRecord::Delta" do
78
81
 
79
82
  @client = Riddle::Client.new
80
83
  @client.stub!(:update => true)
81
- ThinkingSphinx::Configuration.instance.stub!(:client => @client)
84
+ ThinkingSphinx::Connection.stub(:take).and_yield @client
82
85
  end
83
86
 
84
87
  it "shouldn't index if delta indexing is disabled" do
@@ -104,10 +107,8 @@ describe "ThinkingSphinx::ActiveRecord::Delta" do
104
107
  @person.send(:index_delta)
105
108
  end
106
109
 
107
- it "should call indexer for the delta index" do
108
- Person.sphinx_indexes.first.delta_object.should_receive(:`).with(
109
- "#{ThinkingSphinx::Configuration.instance.bin_path}indexer --config \"#{ThinkingSphinx::Configuration.instance.config_file}\" --rotate person_delta"
110
- )
110
+ it "should run the index job" do
111
+ index_job.should_receive(:perform)
111
112
 
112
113
  @person.send(:index_delta)
113
114
  end
@@ -142,7 +142,8 @@ describe ThinkingSphinx::ActiveRecord::Scopes do
142
142
  @config = ThinkingSphinx::Configuration.instance
143
143
  @client = Riddle::Client.new
144
144
 
145
- @config.stub!(:client => @client)
145
+ ThinkingSphinx::Connection.stub(:take).and_yield(@client)
146
+
146
147
  @client.stub!(:query => {:matches => [], :total_found => 43})
147
148
  Alpha.sphinx_scope(:by_name) { |name| {:conditions => {:name => name}} }
148
149
  Alpha.sphinx_scope(:ids_only) { {:ids_only => true} }
@@ -271,7 +271,7 @@ describe ThinkingSphinx::ActiveRecord do
271
271
  @client.stub!(:update => true)
272
272
  @person = Person.find(:first)
273
273
 
274
- @configuration.stub!(:client => @client)
274
+ ThinkingSphinx::Connection.stub(:take).and_yield(@client)
275
275
  Person.sphinx_indexes.each { |index| index.stub!(:delta? => false) }
276
276
  end
277
277
 
@@ -481,7 +481,7 @@ describe ThinkingSphinx::ActiveRecord do
481
481
  before :each do
482
482
  @client = stub('client')
483
483
  ThinkingSphinx.stub!(:sphinx_running? => true)
484
- ThinkingSphinx::Configuration.instance.stub!(:client => @client)
484
+ ThinkingSphinx::Connection.stub(:take).and_yield(@client)
485
485
  end
486
486
 
487
487
  it "should direct the update to the supplied index" do
@@ -127,6 +127,24 @@ describe ThinkingSphinx::AbstractAdapter do
127
127
  should == :postgresql
128
128
  end
129
129
 
130
+ it "translates a JDBC adapter with MySQL connection string to MySQL" do
131
+ klass.stub(:name => 'ActiveRecord::ConnectionAdapters::JdbcAdapter')
132
+ connection.stub(:config => {:adapter => 'jdbc',
133
+ :url => 'jdbc:mysql://127.0.0.1:3306/sphinx'})
134
+
135
+ ThinkingSphinx::AbstractAdapter.standard_adapter_for_model(model).
136
+ should == :mysql
137
+ end
138
+
139
+ it "translates a JDBC adapter with PostgresSQL connection string to PostgresSQL" do
140
+ klass.stub(:name => 'ActiveRecord::ConnectionAdapters::JdbcAdapter')
141
+ connection.stub(:config => {:adapter => 'jdbc',
142
+ :url => 'jdbc:postgresql://127.0.0.1:3306/sphinx'})
143
+
144
+ ThinkingSphinx::AbstractAdapter.standard_adapter_for_model(model).
145
+ should == :postgresql
146
+ end
147
+
130
148
  it "returns other JDBC adapters without translation" do
131
149
  klass.stub(:name => 'ActiveRecord::ConnectionAdapters::JdbcAdapter')
132
150
  connection.stub(:config => {:adapter => 'jdbcmssql'})
@@ -248,74 +248,6 @@ describe ThinkingSphinx::Configuration do
248
248
  end
249
249
  end
250
250
 
251
- describe '#client' do
252
- before :each do
253
- @config = ThinkingSphinx::Configuration.instance
254
- @config.address = 'domain.url'
255
- @config.port = 3333
256
- @config.configuration.searchd.max_matches = 100
257
- @config.timeout = 1
258
- end
259
-
260
- it "should return an instance of Riddle::Client" do
261
- @config.client.should be_a(Riddle::Client)
262
- end
263
-
264
- it "should use the configuration address" do
265
- @config.client.server.should == 'domain.url'
266
- end
267
-
268
- it "should use the configuration port" do
269
- @config.client.port.should == 3333
270
- end
271
-
272
- it "should use the configuration max matches" do
273
- @config.client.max_matches.should == 100
274
- end
275
-
276
- it "should use the configuration timeout" do
277
- @config.client.timeout.should == 1
278
- end
279
-
280
- describe 'when shuffle is enabled' do
281
- let(:client) { double('client', :max_matches= => nil, :timeout= => nil) }
282
-
283
- before :each do
284
- @config.shuffle = true
285
- end
286
-
287
- it "should shuffle client servers" do
288
- @config.address = ['1.1.1.1', '2.2.2.2']
289
- @config.address.stub!(:shuffle => ['2.2.2.2', '1.1.1.1'])
290
-
291
- Riddle::Client.should_receive(:new) do |addresses, port, key|
292
- addresses.should == ['2.2.2.2', '1.1.1.1']
293
- client
294
- end
295
- @config.client
296
- end
297
- end
298
-
299
- describe 'when shuffle is disabled' do
300
- let(:client) { double('client', :max_matches= => nil, :timeout= => nil) }
301
-
302
- before :each do
303
- @config.shuffle = false
304
- end
305
-
306
- it "should not shuffle client servers" do
307
- @config.address = ['1.1.1.1', '2.2.2.2.', '3.3.3.3', '4.4.4.4', '5.5.5.5']
308
-
309
- @config.address.should_not_receive(:shuffle)
310
- Riddle::Client.should_receive(:new) do |addresses, port, key|
311
- addresses.should == ['1.1.1.1', '2.2.2.2.', '3.3.3.3', '4.4.4.4', '5.5.5.5']
312
- client
313
- end
314
- @config.client
315
- end
316
- end
317
- end
318
-
319
251
  describe '#models_by_crc' do
320
252
  before :each do
321
253
  @config = ThinkingSphinx::Configuration.instance
@@ -0,0 +1,77 @@
1
+ require 'spec_helper'
2
+
3
+ describe ThinkingSphinx::Connection do
4
+ describe '#client' do
5
+ let(:connection) { ThinkingSphinx::Connection.new }
6
+
7
+ before :each do
8
+ @config = ThinkingSphinx::Configuration.instance
9
+ @config.address = 'domain.url'
10
+ @config.port = 3333
11
+ @config.configuration.searchd.max_matches = 100
12
+ @config.timeout = 1
13
+
14
+ pending
15
+ end
16
+
17
+ it "should return an instance of Riddle::Client" do
18
+ connection.client.should be_a(Riddle::Client)
19
+ end
20
+
21
+ it "should use the configuration address" do
22
+ connection.client.server.should == 'domain.url'
23
+ end
24
+
25
+ it "should use the configuration port" do
26
+ connection.client.port.should == 3333
27
+ end
28
+
29
+ it "should use the configuration max matches" do
30
+ connection.client.max_matches.should == 100
31
+ end
32
+
33
+ it "should use the configuration timeout" do
34
+ connection.client.timeout.should == 1
35
+ end
36
+
37
+ describe 'when shuffle is enabled' do
38
+ let(:client) { double('client', :max_matches= => nil, :timeout= => nil,
39
+ :open => true) }
40
+
41
+ before :each do
42
+ @config.shuffle = true
43
+ end
44
+
45
+ it "should shuffle client servers" do
46
+ @config.address = ['1.1.1.1', '2.2.2.2']
47
+ @config.address.stub!(:shuffle => ['2.2.2.2', '1.1.1.1'])
48
+
49
+ Riddle::Client.should_receive(:new) do |addresses, port, key|
50
+ addresses.should == ['2.2.2.2', '1.1.1.1']
51
+ client
52
+ end
53
+ connection.client
54
+ end
55
+ end
56
+
57
+ describe 'when shuffle is disabled' do
58
+ let(:client) { double('client', :max_matches= => nil, :timeout= => nil,
59
+ :open => true) }
60
+
61
+ before :each do
62
+ @config.shuffle = false
63
+ end
64
+
65
+ it "should not shuffle client servers" do
66
+ @config.address = ['1.1.1.1', '2.2.2.2.', '3.3.3.3', '4.4.4.4', '5.5.5.5']
67
+
68
+ @config.address.should_not_receive(:shuffle)
69
+ Riddle::Client.should_receive(:new) do |addresses, port, key|
70
+ addresses.should == ['1.1.1.1', '2.2.2.2.', '3.3.3.3', '4.4.4.4', '5.5.5.5']
71
+ client
72
+ end
73
+ connection.client
74
+ end
75
+ end
76
+ end
77
+ end
@@ -4,16 +4,16 @@ describe ThinkingSphinx::FacetSearch do
4
4
  let(:search) { stub('search', :append_to => nil, :empty? => true) }
5
5
  let(:config) { ThinkingSphinx::Configuration.instance }
6
6
  let(:client) { stub('client', :run => []) }
7
-
7
+
8
8
  before :each do
9
- config.stub!(:client => client)
9
+ ThinkingSphinx::Connection.stub!(:take).and_yield(client)
10
10
  end
11
-
11
+
12
12
  describe 'populate' do
13
13
  before :each do
14
14
  config.configuration.searchd.max_matches = 10_000
15
15
  end
16
-
16
+
17
17
  it "should request all shared facets in a multi-model request by default" do
18
18
  ThinkingSphinx.stub!(:search => search)
19
19
  if Riddle.loaded_version.to_i < 2
@@ -22,28 +22,28 @@ describe ThinkingSphinx::FacetSearch do
22
22
  ThinkingSphinx::FacetSearch.new.facet_names.should == ['sphinx_internal_class']
23
23
  end
24
24
  end
25
-
25
+
26
26
  it "should request all facets in a multi-model request if specified" do
27
27
  ThinkingSphinx.stub!(:search => search)
28
28
  names = ThinkingSphinx::FacetSearch.new(:all_facets => true).facet_names
29
-
29
+
30
30
  if Riddle.loaded_version.to_i < 2
31
31
  names.should == ['class_crc', 'city_facet', 'state_facet', 'birthday']
32
32
  else
33
33
  names.should == ['sphinx_internal_class', 'city_facet', 'state_facet', 'birthday']
34
34
  end
35
35
  end
36
-
36
+
37
37
  it "should use the system-set max_matches for limit on facet calls" do
38
38
  ThinkingSphinx.should_receive(:search) do |options|
39
39
  options[:max_matches].should == 10_000
40
40
  options[:limit].should == 10_000
41
41
  search
42
42
  end
43
-
43
+
44
44
  ThinkingSphinx::FacetSearch.new
45
45
  end
46
-
46
+
47
47
  it "should use the default max-matches if there is no explicit setting" do
48
48
  config.configuration.searchd.max_matches = nil
49
49
  ThinkingSphinx.should_receive(:search) do |options|
@@ -51,32 +51,32 @@ describe ThinkingSphinx::FacetSearch do
51
51
  options[:limit].should == 1000
52
52
  search
53
53
  end
54
-
54
+
55
55
  ThinkingSphinx::FacetSearch.new
56
56
  end
57
-
57
+
58
58
  it "should ignore user-provided max_matches and limit on facet calls" do
59
59
  ThinkingSphinx.should_receive(:search) do |options|
60
60
  options[:max_matches].should == 10_000
61
61
  options[:limit].should == 10_000
62
62
  search
63
63
  end
64
-
64
+
65
65
  ThinkingSphinx::FacetSearch.new(
66
66
  :max_matches => 500,
67
67
  :limit => 200
68
68
  )
69
69
  end
70
-
70
+
71
71
  it "should not use an explicit :page" do
72
72
  ThinkingSphinx.should_receive(:search) do |options|
73
73
  options[:page].should == 1
74
74
  search
75
75
  end
76
-
76
+
77
77
  ThinkingSphinx::FacetSearch.new(:page => 3)
78
78
  end
79
-
79
+
80
80
  describe "conflicting facets" do
81
81
  before :each do
82
82
  @index = ThinkingSphinx::Index::Builder.generate(Alpha) do
@@ -84,28 +84,28 @@ describe ThinkingSphinx::FacetSearch do
84
84
  has :value, :as => :city, :facet => true
85
85
  end
86
86
  end
87
-
87
+
88
88
  after :each do
89
89
  Alpha.sphinx_facets.delete_at(-1)
90
90
  end
91
-
91
+
92
92
  it "should raise an error if searching with facets of same name but different type" do
93
93
  lambda {
94
94
  facets = ThinkingSphinx.facets :all_facets => true
95
95
  }.should raise_error
96
96
  end
97
97
  end
98
-
98
+
99
99
  describe ':facets option' do
100
100
  it "should limit facets to the requested set" do
101
101
  ThinkingSphinx.should_receive(:search).once.and_return(search)
102
-
102
+
103
103
  ThinkingSphinx::FacetSearch.new(
104
104
  :classes => [Person], :facets => :state
105
105
  )
106
106
  end
107
107
  end
108
-
108
+
109
109
  describe "empty result set for attributes" do
110
110
  before :each do
111
111
  ThinkingSphinx.stub!(:search => search)
@@ -113,7 +113,7 @@ describe ThinkingSphinx::FacetSearch do
113
113
  :classes => [Person], :facets => :state
114
114
  )
115
115
  end
116
-
116
+
117
117
  it "should add key as attribute" do
118
118
  @facets.should have_key(:state)
119
119
  end
@@ -131,7 +131,7 @@ describe ThinkingSphinx::FacetSearch do
131
131
  search.stub!(:each_with_match).
132
132
  and_yield(@person, {:attributes => {'@groupby' => @person.city.to_crc32, '@count' => 1}})
133
133
  ThinkingSphinx::Search.stub!(:bundle_searches => [search])
134
-
134
+
135
135
  @facets = ThinkingSphinx::FacetSearch.new(
136
136
  :classes => [Person], :facets => :city
137
137
  )
@@ -150,7 +150,7 @@ describe ThinkingSphinx::FacetSearch do
150
150
  end
151
151
  end
152
152
  end
153
-
153
+
154
154
  describe "#for" do
155
155
  before do
156
156
  @person = Person.find(:first)
@@ -158,7 +158,7 @@ describe ThinkingSphinx::FacetSearch do
158
158
  search.stub!(:each_with_match).
159
159
  and_yield(@person, {:attributes => {'@groupby' => @person.city.to_crc32, '@count' => 1}})
160
160
  ThinkingSphinx::Search.stub!(:bundle_searches => [search])
161
-
161
+
162
162
  @facets = ThinkingSphinx::FacetSearch.new(
163
163
  :classes => [Person], :facets => :city
164
164
  )
@@ -169,7 +169,7 @@ describe ThinkingSphinx::FacetSearch do
169
169
  options[:with].should have_key('city_facet')
170
170
  options[:with]['city_facet'].should == @person.city.to_crc32
171
171
  end
172
-
172
+
173
173
  @facets.for(:city => @person.city)
174
174
  end
175
175
  end
@@ -4,150 +4,150 @@ describe ThinkingSphinx::SearchMethods do
4
4
  it "should be included into models with indexes" do
5
5
  Alpha.included_modules.should include(ThinkingSphinx::SearchMethods)
6
6
  end
7
-
7
+
8
8
  it "should not be included into models that don't have indexes" do
9
9
  Gamma.included_modules.should_not include(ThinkingSphinx::SearchMethods)
10
10
  end
11
-
11
+
12
12
  describe '.search_context' do
13
13
  it "should return nil if not within a model" do
14
14
  ThinkingSphinx.search_context.should be_nil
15
15
  end
16
-
16
+
17
17
  it "should return the model if within one" do
18
18
  Alpha.search_context.should == Alpha
19
19
  end
20
20
  end
21
-
21
+
22
22
  describe '.search' do
23
23
  it "should return an instance of ThinkingSphinx::Search" do
24
24
  Alpha.search.class.should == ThinkingSphinx::Search
25
25
  end
26
-
26
+
27
27
  it "should set the classes option if not already set" do
28
28
  search = Alpha.search
29
29
  search.options[:classes].should == [Alpha]
30
30
  end
31
-
31
+
32
32
  it "shouldn't set the classes option if already defined" do
33
33
  search = Alpha.search :classes => [Beta]
34
34
  search.options[:classes].should == [Beta]
35
35
  end
36
-
36
+
37
37
  it "should default to nil for the classes options" do
38
38
  ThinkingSphinx.search.options[:classes].should be_nil
39
39
  end
40
40
  end
41
-
41
+
42
42
  describe '.search_for_ids' do
43
43
  it "should return an instance of ThinkingSphinx::Search" do
44
44
  Alpha.search.class.should == ThinkingSphinx::Search
45
45
  end
46
-
46
+
47
47
  it "should set the classes option if not already set" do
48
48
  search = Alpha.search_for_ids
49
49
  search.options[:classes].should == [Alpha]
50
50
  end
51
-
51
+
52
52
  it "shouldn't set the classes option if already defined" do
53
53
  search = Alpha.search_for_ids :classes => [Beta]
54
54
  search.options[:classes].should == [Beta]
55
55
  end
56
-
56
+
57
57
  it "should set ids_only to true" do
58
58
  search = Alpha.search_for_ids
59
59
  search.options[:ids_only].should be_true
60
60
  end
61
61
  end
62
-
62
+
63
63
  describe '.search_for_id' do
64
64
  before :each do
65
65
  @config = ThinkingSphinx::Configuration.instance
66
66
  @client = Riddle::Client.new
67
67
 
68
- @config.stub!(:client => @client)
68
+ ThinkingSphinx::Connection.stub!(:take).and_yield(@client)
69
69
  @client.stub!(:query => {:matches => [], :total_found => 0})
70
70
  end
71
-
71
+
72
72
  it "should set the id range to the given id value" do
73
73
  ThinkingSphinx.search_for_id(101, 'alpha_core')
74
-
74
+
75
75
  @client.id_range.should == (101..101)
76
76
  end
77
-
77
+
78
78
  it "should not make any calls to the database" do
79
79
  Alpha.should_not_receive(:find)
80
-
80
+
81
81
  ThinkingSphinx.search_for_id(101, 'alpha_core', :classes => [Alpha])
82
82
  end
83
-
83
+
84
84
  it "should return true if there is a record" do
85
85
  @client.stub!(:query => {:matches => [
86
86
  {:attributes => {'sphinx_internal_id' => 100}}
87
87
  ], :total_found => 1})
88
-
88
+
89
89
  ThinkingSphinx.search_for_id(101, 'alpha_core').should be_true
90
90
  end
91
-
91
+
92
92
  it "should return false if there isn't a record" do
93
93
  ThinkingSphinx.search_for_id(101, 'alpha_core').should be_false
94
94
  end
95
95
  end
96
-
96
+
97
97
  describe '.count' do
98
98
  before :each do
99
99
  @config = ThinkingSphinx::Configuration.instance
100
100
  @client = Riddle::Client.new
101
101
 
102
- @config.stub!(:client => @client)
102
+ ThinkingSphinx::Connection.stub!(:take).and_yield(@client)
103
103
  @client.stub!(:query => {:matches => [], :total_found => 42})
104
104
  end
105
-
105
+
106
106
  it "should fall through to ActiveRecord if called on a class" do
107
107
  @client.should_not_receive(:query)
108
-
108
+
109
109
  Alpha.count
110
110
  end
111
-
111
+
112
112
  it "should return the total number of results if called globally" do
113
113
  ThinkingSphinx.count.should == 42
114
114
  end
115
115
  end
116
-
116
+
117
117
  describe '.search_count' do
118
118
  before :each do
119
119
  @config = ThinkingSphinx::Configuration.instance
120
120
  @client = Riddle::Client.new
121
121
 
122
- @config.stub!(:client => @client)
122
+ ThinkingSphinx::Connection.stub!(:take).and_yield(@client)
123
123
  @client.stub!(:query => {:matches => [], :total_found => 42})
124
124
  end
125
-
125
+
126
126
  it "should return the total number of results" do
127
127
  Alpha.search_count.should == 42
128
128
  end
129
-
129
+
130
130
  it "should not make any calls to the database" do
131
131
  Alpha.should_not_receive(:find)
132
-
132
+
133
133
  Alpha.search_count
134
134
  end
135
135
  end
136
-
136
+
137
137
  describe '.facets' do
138
138
  before :each do
139
139
  ThinkingSphinx::Search.stub!(:bundle_searches => [])
140
140
  end
141
-
141
+
142
142
  it "should return a FacetSearch instance" do
143
143
  Alpha.facets.should be_a(ThinkingSphinx::FacetSearch)
144
144
  end
145
-
145
+
146
146
  it "should set the classes option if not already set" do
147
147
  facets = Alpha.facets
148
148
  facets.options[:classes].should == [Alpha]
149
149
  end
150
-
150
+
151
151
  it "shouldn't set the classes option if already defined" do
152
152
  facets = Alpha.facets :classes => [Beta]
153
153
  facets.options[:classes].should == [Beta]