Example #1
0
 });
 describe("::camelback()", function () {
     it("camelbacks a string", function () {
         expect(Inflector::camelback('test-field'))->toBe('testField');
         expect(Inflector::camelback('test field'))->toBe('testField');
         expect(Inflector::camelback('TEST_FIELD'))->toBe('testField');
         expect(Inflector::camelback('TestField'))->toBe('testField');
         expect(Inflector::camelback('my_name\\space'))->toBe('myName\\Space');
     });
 });
 describe("::titleize()", function () {
     it("titleizes a string", function () {
         expect(Inflector::titleize('posts'))->toBe('Posts');
         expect(Inflector::titleize('posts_tags'))->toBe('Posts Tags');
         expect(Inflector::titleize('file_systems'))->toBe('File Systems');
         expect(Inflector::titleize('the-post-title', '-'))->toBe('The Post Title');
     });
 });
 describe("::humanize()", function () {
     it("humanizes a string", function () {
         expect(Inflector::humanize('posts'))->toBe('Posts');
         expect(Inflector::humanize('post_id'))->toBe('Post');
         expect(Inflector::humanize('posts_tags'))->toBe('Posts tags');
         expect(Inflector::humanize('file_systems'))->toBe('File systems');
         expect(Inflector::humanize('the-post-title', '-'))->toBe('The post title');
     });
 });
 describe("::plural()", function () {
     beforeEach(function () {
         Inflector::reset();
     });