test/unit/ut_15_util.rb in ruote-2.3.0.1 vs test/unit/ut_15_util.rb in ruote-2.3.0.2

- old
+ new

@@ -51,7 +51,37 @@ assert_equal Klass, b.class assert_not_equal a.object_id, b.object_id assert_equal 'hello', b.instance_variable_get(:@s) end + + def test_camelize + + assert_equal( + 'alphaBravoCharly', Ruote.camelize('alpha_bravo_charly')) + assert_equal( + 'AlphaBravoCharly', Ruote.camelize('alpha_bravo_charly', true)) + end + + def test_decamelize + + assert_equal( + 'alpha_bravo_charly', Ruote.decamelize('alphaBravoCharly')) + assert_equal( + 'alpha_bravo_charly', Ruote.decamelize('AlphaBravoCharly')) + end + + def test_insp + + assert_equal( + '{a: [a, b], c: 3, d: true}', + Ruote.insp({ 'a' => %w[ a b ], 'c' => 3, 'd' => true })) + end + + def test_pps + + assert_equal( + "{\"a\"=>[\"a\", \"b\"], \"c\"=>3, \"d\"=>true}\n", + Ruote.pps({ 'a' => %w[ a b ], 'c' => 3, 'd' => true })) + end end