ruby-sdk/test/model_context_protocol/string_utils_test.rb
Ates Goral c5591be30b Internal Release 0.2.4
- remove activesupport as a runtime dependency
- use alternative to activesupport/inflector methods
- use `json_rpc_handler` gem
- add json_rpc_handler to gem dependencies
2025-05-08 17:37:45 -04:00

22 lines
1,016 B
Ruby

# frozen_string_literal: true
require "test_helper"
module ModelContextProtocol
class StringUtilsTest < Minitest::Test
def test_handle_from_class_name_returns_the_class_name_without_the_module_for_a_class_without_a_module
assert_equal("test", StringUtils.handle_from_class_name("Test"))
assert_equal("test_class", StringUtils.handle_from_class_name("TestClass"))
end
def test_handle_from_class_name_returns_the_class_name_without_the_module_for_a_class_with_a_single_parent_module
assert_equal("test", StringUtils.handle_from_class_name("Module::Test"))
assert_equal("test_class", StringUtils.handle_from_class_name("Module::TestClass"))
end
def test_handle_from_class_name_returns_the_class_name_without_the_module_for_a_class_with_multiple_parent_modules
assert_equal("test", StringUtils.handle_from_class_name("Module::Submodule::Test"))
assert_equal("test_class", StringUtils.handle_from_class_name("Module::Submodule::TestClass"))
end
end
end