Skip to content

Commit 096fbde

Browse files
mlarraznhtruong
andauthored
Fix incorrect variable name (#247)
* Fix incorrect variable name Signed-off-by: Matt Larraz <[email protected]> * # Added tests Signed-off-by: Theo Truong <[email protected]> * # Updated CHANGELOG.md Signed-off-by: Theo Truong <[email protected]> * # Added License header Signed-off-by: Theo Truong <[email protected]> --------- Signed-off-by: Matt Larraz <[email protected]> Signed-off-by: Theo Truong <[email protected]> Co-authored-by: Theo Truong <[email protected]>
1 parent 6bafe83 commit 096fbde

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
88
### Deprecated
99
### Removed
1010
### Fixed
11+
- Fixed variable name in `OpenSearch::Client#respond_to_missing?` ([#247](https://github.com/opensearch-project/opensearch-ruby/pull/247))
1112
### Security
1213

1314
## [3.2.0]

lib/opensearch.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def method_missing(name, *args, &block)
4949
end
5050

5151
def respond_to_missing?(method_name, include_private = false)
52-
name == :perform_request || super
52+
method_name == :perform_request || super
5353
end
5454

5555
private

lib/opensearch/dsl/search.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def method_missing(name, *args, &block)
250250
end
251251

252252
def respond_to_missing?(method_name, include_private = false)
253-
@options.respond_to?(name) || super
253+
@options.respond_to?(method_name) || super
254254
end
255255

256256
# Converts the search definition to a Hash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# The OpenSearch Contributors require contributions made to
4+
# this file be licensed under the Apache-2.0 license or a
5+
# compatible open source license.
6+
#
7+
# Modifications Copyright OpenSearch Contributors. See
8+
# GitHub history for details.
9+
10+
require_relative '../../../spec_helper'
11+
12+
describe 'OpenSearch::Client#respond_to_missing?' do
13+
it 'returns to correct results' do
14+
client = OpenSearch::Client.new
15+
expect(client.send(:respond_to_missing?, :perform_request)).to be true
16+
expect(client.send(:respond_to_missing?, :something_else)).to be false
17+
end
18+
end

0 commit comments

Comments
 (0)