883N/A# The ASF licenses this file to You under the Apache License, Version 2.0
883N/A# (the "License"); you may not use this file except in compliance with
883N/A# the License. You may obtain a copy of the License at
883N/A#
883N/A# http://www.apache.org/licenses/LICENSE-2.0
883N/A#
883N/A# Unless required by applicable law or agreed to in writing, software
883N/A# distributed under the License is distributed on an "AS IS" BASIS,
883N/A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
883N/A# See the License for the specific language governing permissions and
883N/A# limitations under the License.
883N/A
883N/Arequire 'solr_mock_base'
883N/A
883N/Aclass SpellcheckResponseTest < SolrMockBaseTestCase
883N/A def test_basic
883N/A ruby_code = "{'responseHeader'=>{'status'=>0,'QTime'=>5},'suggestions'=>['whately','whatcha','whatever']}"
883N/A conn = Solr::Connection.new 'http://localhost:9999'
883N/A set_post_return(ruby_code)
883N/A response = conn.send(Solr::Request::Spellcheck.new(:query => 'whateva'))
883N/A assert_equal true, response.ok?
883N/A assert_equal 3, response.suggestions.size
883N/A assert_equal ['whately','whatcha','whatever'], response.suggestions
883N/A end
883N/Aend
883N/A
883N/A