test: add test harness with http and router tests

This commit is contained in:
dualfroz committed 2026-08-27 11:40:00 +02:00
1 parent b8e3b2cd55
commit c079abed00
6 files changed
+239

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
require 'minitest/autorun'
require 'prism'
class InflectorTest < Minitest::Test
include Prism::Inflector
def test_underscore
assert_equal 'posts_controller', underscore('PostsController')
assert_equal 'html_parser', underscore('HTMLParser')
end
def test_camelize
assert_equal 'PostsController', camelize('posts_controller')
end
def test_pluralize
assert_equal 'posts', pluralize('post')
assert_equal 'categories', pluralize('category')
assert_equal 'boxes', pluralize('box')
assert_equal 'leaves', pluralize('leaf')
end
def test_singularize
assert_equal 'category', singularize('categories')
assert_equal 'post', singularize('posts')
assert_equal 'box', singularize('boxes')
end
def test_tableize
assert_equal 'categories', tableize('Category')
assert_equal 'posts', tableize('Post')
end
def test_classify
assert_equal 'Category', classify('categories')
end
end