diff --git a/lib/tty/prompt/list.rb b/lib/tty/prompt/list.rb index 09092e4b..b71d0262 100644 --- a/lib/tty/prompt/list.rb +++ b/lib/tty/prompt/list.rb @@ -207,7 +207,7 @@ def choices(values = (not_set = true)) else filter_value = @filter.join.downcase @filter_cache[filter_value] ||= @choices.enabled.select do |choice| - choice.name.downcase.include?(filter_value) + choice.name.to_s.downcase.include?(filter_value) end end else diff --git a/spec/unit/select_spec.rb b/spec/unit/select_spec.rb index 08007a71..b733711e 100644 --- a/spec/unit/select_spec.rb +++ b/spec/unit/select_spec.rb @@ -781,8 +781,8 @@ def exit_message(prompt, choice) prompt.input << "g" << "\r" prompt.input.rewind - answer = prompt.select("What size?", %w(Small Medium Large Huge), filter: true) - expect(answer).to eql("Large") + answer = prompt.select("What size?", %i(Small Medium Large Huge), filter: true) + expect(answer).to eql(:Large) actual_prompt_output = prompt.output.string expected_prompt_output =