<commit_before>define(function() {
    var Am = window.Am;

    describe("Am", function() {
        describe("Event", function() {
            describe("Event", function() {
                describe("Event()", function() {
                    it("shoud accept calls with name and target arguments", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");

                        done();
                    });

                    it("shoud accept calls with name, target and data arguments", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say", { message: "Hello" });

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");
                        expect(event.get("data").message).to.equal("Hello");

                        done();
                    });
                });

                describe("instance.get()", function() {
                    it("should return the value of specified attribute", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");

                        done();
                    });
                });

                describe("instance.set()", function() {
                    it("should set the value of specified attribute", function(done) {
                        var personA = {};
                        var personB = {};

                        var event = new Am.Event.Event(personA, "say");

                        event.set("target", personB);
                        event.setName("test");

                        expect(event.get("target")).to.equal(personB);
                        expect(event.get("name")).to.equal("test");

                        done();
                    });

                    it("should set the value of specified attributes", function(done) {
                        var personA = {};
                        var personB = {};

                        var event = new Am.Event.Event(personA, "say");

                        event.set({
                            target: personB,
                            name: "test"
                        });

                        expect(event.get("target")).to.equal(personB);
                        expect(event.get("name")).to.equal("test");


                        done();
                    });
                });

                describe("instance.has()", function() {
                    it("should check whether the specified attribute exists", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.has("name")).to.be.true;
                        expect(event.has("fakeAttribute")).to.be.false;

                        done();
                    });
                });

                describe("instance.toObject()", function() {
                    it("should return an object representation of the caller", function(done) {
                        var Person = Am.Model.create("Person", ["name"]);
                        var person = new Person("John");

                        var event = new Am.Event.Event(person, "say", { message: "Hello" });
                        var object = event.toObject();

                        expect(object.target.name).to.equal(person.name);
                        expect(object.name).to.equal("say");
                        expect(object.data.message).to.equal("Hello");

                        done();
                    });
                });
            });
        });
    });
});<commit_msg>Test: fixed issue with test for Core.Event.Event toObject().<commit_after>define(function() {
    var Am = window.Am;

    describe("Am", function() {
        describe("Event", function() {
            describe("Event", function() {
                describe("Event()", function() {
                    it("shoud accept calls with name and target arguments", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");

                        done();
                    });

                    it("shoud accept calls with name, target and data arguments", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say", { message: "Hello" });

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");
                        expect(event.get("data").message).to.equal("Hello");

                        done();
                    });
                });

                describe("instance.get()", function() {
                    it("should return the value of specified attribute", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.get("target")).to.equal(person);
                        expect(event.get("name")).to.equal("say");

                        done();
                    });
                });

                describe("instance.set()", function() {
                    it("should set the value of specified attribute", function(done) {
                        var personA = {};
                        var personB = {};

                        var event = new Am.Event.Event(personA, "say");

                        event.set("target", personB);
                        event.setName("test");

                        expect(event.get("target")).to.equal(personB);
                        expect(event.get("name")).to.equal("test");

                        done();
                    });

                    it("should set the value of specified attributes", function(done) {
                        var personA = {};
                        var personB = {};

                        var event = new Am.Event.Event(personA, "say");

                        event.set({
                            target: personB,
                            name: "test"
                        });

                        expect(event.get("target")).to.equal(personB);
                        expect(event.get("name")).to.equal("test");


                        done();
                    });
                });

                describe("instance.has()", function() {
                    it("should check whether the specified attribute exists", function(done) {
                        var person = {};

                        var event = new Am.Event.Event(person, "say");

                        expect(event.has("name")).to.be.true;
                        expect(event.has("fakeAttribute")).to.be.false;

                        done();
                    });
                });

                describe("instance.toObject()", function() {
                    it("should return an object representation of the caller", function(done) {
                        var Person = Am.Model.create("Person", ["name"]);
                        var person = new Person("John");

                        var event = new Am.Event.Event(person, "say", { message: "Hello" });
                        var object = event.toObject();

                        expect(object.target.name).to.equal(person.get("name"));
                        expect(object.name).to.equal("say");
                        expect(object.data.message).to.equal("Hello");

                        done();
                    });
                });
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.13525983487129675, 'fraction_numerical': 0.0, 'mean_word_length': 1.076380136123015, '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': '4531163', 'n_tokens_mistral': 1919, 'n_tokens_neox': 1718, 'n_words': 361}