<commit_before>/**
 * Test lib/brick.js
 * */
var expect = require("chai").expect;
var Brick = require("../lib/brick");

describe("lego.brick", function () {

    describe("Brick.create", function () {
        it("handle should be a function", function () {
            expect(function () {
                Brick.create("brick with no handle");
            }).to.throw(Error);
        });

        it("should return a sub class of Brick", function () {
            var brick = Brick.create("testBrick", function () {
            });

            expect(brick.prototype).to.be.an.instanceof(Brick);
        });

        it("should set handle to brick's prototype", function () {
            var handler = function () {
            };
            var brick = Brick.create("testBrick", handler);

            expect(brick.prototype.handle).to.be.equal(handler);
        });

        it("should set Brick.Name" , function(){
            var name = "NameOfBrick";
            var brick = Brick.create(name , function(){});
            expect(brick.Name).to.equal(name);
        });
    });

});<commit_msg>brick<commit_after>/**
 * Test lib/brick.js
 * */
var expect = require("chai").expect;
var Brick = require("../lib/brick");

describe("lego.Brick", function () {

    describe("Brick.create", function () {
        it("handle should be a function", function () {
            expect(function () {
                Brick.create("brick with no handle");
            }).to.throw(Error);
        });

        it("should return a sub class of Brick", function () {
            var brick = Brick.create("testBrick", function () {
            });

            expect(brick.prototype).to.be.an.instanceof(Brick);
        });

        it("should set handle to brick's prototype", function () {
            var handler = function () {
            };
            var brick = Brick.create("testBrick", handler);

            expect(brick.prototype.handle).to.be.equal(handler);
        });

        it("should set Brick.Name" , function(){
            var name = "NameOfBrick";
            var brick = Brick.create(name , function(){});
            expect(brick.Name).to.equal(name);
        });
    });

});
{'fraction_non_alphanumeric': 0.16226071103008205, 'fraction_numerical': 0.0, 'mean_word_length': 1.9384203480589022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4687885', 'n_tokens_mistral': 626, 'n_tokens_neox': 607, 'n_words': 130}