|
15 | 15 | # specific language governing permissions and limitations
|
16 | 16 | # under the License.
|
17 | 17 |
|
18 |
| -require 'spec_helper' |
19 | 18 | require 'elastic-transport'
|
| 19 | +require 'spec_helper' |
| 20 | + |
20 | 21 | require_relative File.expand_path('../../utils/thor/endpoint_spec', __dir__)
|
21 | 22 | require_relative File.expand_path('../../utils/thor/generator/files_helper', __dir__)
|
22 | 23 |
|
|
28 | 29 | # TODO: Once the test suite is migrated to elasticsearch-specification, these should be removed
|
29 | 30 | spec.module_namespace.flatten.first == 'rollup' ||
|
30 | 31 | [
|
31 |
| - 'scroll', 'clear_scroll', 'connector.last_sync', 'knn_search', |
32 |
| - 'indices.remove_block' |
| 32 | + 'scroll', 'clear_scroll', 'connector.last_sync', 'knn_search' |
33 | 33 | ].include?(spec.endpoint_name)
|
34 | 34 |
|
35 | 35 | # These are the path parts defined by the user in the method argument
|
|
66 | 66 | { endpoint: spec.endpoint_name, defined_params: defined_path_parts }
|
67 | 67 | end
|
68 | 68 | end
|
69 |
| - |
70 |
| - if spec.path_parts.empty? |
71 |
| - it "passes the endpoint id to the request" do |
72 |
| - if spec.module_namespace.empty? |
73 |
| - client_double.send(spec.method_name, required_params) |
74 |
| - else |
75 |
| - client_double.send(spec.module_namespace[0]).send(spec.method_name, required_params) |
| 69 | + begin |
| 70 | + if spec.path_parts.empty? |
| 71 | + it "passes the endpoint id to the request" do |
| 72 | + if spec.module_namespace.empty? |
| 73 | + client_double.send(spec.method_name, required_params) |
| 74 | + else |
| 75 | + client_double.send(spec.module_namespace[0]).send(spec.method_name, required_params) |
| 76 | + end |
76 | 77 | end
|
77 |
| - end |
78 |
| - else |
79 |
| - it "passes params to the request with the endpoint id: #{spec.path_parts.keys}" do |
80 |
| - if spec.module_namespace.empty? |
81 |
| - client_double.send(spec.method_name, required_params.merge(defined_path_parts)) |
82 |
| - else |
83 |
| - client_double.send( |
84 |
| - spec.module_namespace[0]).send(spec.method_name, required_params.merge(defined_path_parts) |
85 |
| - ) |
| 78 | + else |
| 79 | + it "passes params to the request with the endpoint id: #{spec.path_parts.keys}" do |
| 80 | + if spec.module_namespace.empty? |
| 81 | + client_double.send(spec.method_name, required_params.merge(defined_path_parts)) |
| 82 | + else |
| 83 | + client_double.send( |
| 84 | + spec.module_namespace[0] |
| 85 | + ).send( |
| 86 | + spec.method_name, required_params.merge(defined_path_parts) |
| 87 | + ) |
| 88 | + end |
86 | 89 | end
|
87 | 90 | end
|
| 91 | + rescue NoMethodError |
| 92 | + Logger.new($stdout).info("Method #{spec.method_name} not implemented yet") |
88 | 93 | end
|
89 | 94 | end
|
90 | 95 | end
|
|
0 commit comments