forked from elastic/elasticsearch-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadapter_default_test.rb
41 lines (32 loc) · 1.3 KB
/
adapter_default_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'test_helper'
class Elasticsearch::Model::AdapterDefaultTest < Test::Unit::TestCase
context "Adapter default module" do
class ::DummyClassForDefaultAdapter; end
should "have the default Records implementation" do
assert_instance_of Module, Elasticsearch::Model::Adapter::Default::Records
DummyClassForDefaultAdapter.__send__ :include, Elasticsearch::Model::Adapter::Default::Records
instance = DummyClassForDefaultAdapter.new
klass = mock('class', find: [1])
instance.expects(:klass).returns(klass)
instance.records
end
should "have the default Callbacks implementation" do
assert_instance_of Module, Elasticsearch::Model::Adapter::Default::Callbacks
end
context "concerning abstract methods" do
setup do
DummyClassForDefaultAdapter.__send__ :include, Elasticsearch::Model::Adapter::Default::Importing
end
should "have the default Importing implementation" do
assert_raise Elasticsearch::Model::NotImplemented do
DummyClassForDefaultAdapter.new.__find_in_batches
end
end
should "have the default transform implementation" do
assert_raise Elasticsearch::Model::NotImplemented do
DummyClassForDefaultAdapter.new.__transform
end
end
end
end
end