<commit_before>(function() {

    describe('xin.data', function() {

        describe('Dependency', function() {
            it('can access localstorage', function() {
                expect(localStorage).toBeTypedOf("object");
            });

            it('has writable permission to localstorage', function() {
                expect(function() {
                    localStorage.clear();
                }).not.toThrow();
            });
        });

        describe('Repository', function() {

            it('can be constructed', function() {
                expect(new xin.data.Repository()).toBeInstanceOf(xin.data.Repository);
            });

            it('can be run as function', function() {
                expect(xin.data.Repository()).toBeInstanceOf(xin.data.Repository);
            });

            describe('CRUD', function() {
                it('can create a record', function() {
                    var next = false;

                    expect(function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'dodi', 'age': 21});
                            repo.save({'name':'budi', 'age': 22});
                            next = true;
                        });
                    }).not.toThrow();

                    waitsFor(function() {
                        return next;
                    });
                });

                it('can update a record', function() {
                    var repo = new xin.data.Repository({}, function() {
                        repo.save({'name':'susi', 'age': 20});
                        repo.all(function(err, data) {
                            var obj = data[0];
                            var name = obj.name;
                            obj.name = "nunu";
                            repo.save(obj);
                            repo.get(data[0].key, function(err, record) {
                                expect(record.name).not.toBe(name);
                            });
                        });
                    });
                });

                describe('can read (a) record(s) which has been writen', function() {
                    it('can get all records', function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'banu', 'age': 20});
                            expect(function() {
                                repo.all(function(err, data) {
                                    if (err) throw new Error(err.message);
                                });
                            }).not.toThrow();
                        });
                    });

                    it('can get a single record', function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'susi', 'age': 20});
                            repo.all(function(err, data) {
                                expect(function() {<commit_msg>Change toEqual specs on update function<commit_after>(function() {

    describe('xin.data', function() {

        describe('Dependency', function() {
            it('can access localstorage', function() {
                expect(localStorage).toBeTypedOf("object");
            });

            it('has writable permission to localstorage', function() {
                expect(function() {
                    localStorage.clear();
                }).not.toThrow();
            });
        });

        describe('Repository', function() {

            it('can be constructed', function() {
                expect(new xin.data.Repository()).toBeInstanceOf(xin.data.Repository);
            });

            it('can be run as function', function() {
                expect(xin.data.Repository()).toBeInstanceOf(xin.data.Repository);
            });

            describe('CRUD', function() {
                it('can create a record', function() {
                    var next = false;

                    expect(function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'dodi', 'age': 21});
                            repo.save({'name':'budi', 'age': 22});
                            next = true;
                        });
                    }).not.toThrow();

                    waitsFor(function() {
                        return next;
                    });
                });

                it('can update a record', function() {
                    var repo = new xin.data.Repository({}, function() {
                        repo.save({'name':'susi', 'age': 20});
                        repo.all(function(err, data) {
                            var obj = data[0];
                            obj.name = "nunu";
                            repo.save(obj);
                            repo.get(data[0].key, function(err, record) {
                                expect(record).not.toEqual(obj);
                            });
                        });
                    });
                });

                describe('can read (a) record(s) which has been writen', function() {
                    it('can get all records', function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'banu', 'age': 20});
                            expect(function() {
                                repo.all(function(err, data) {
                                    if (err) throw new Error(err.message);
                                });
                            }).not.toThrow();
                        });
                    });

                    it('can get a single record', function() {
                        var repo = new xin.data.Repository({}, function() {
                            repo.save({'name':'susi', 'age': 20});
                            repo.all(function(err, data) {
                                expect(function() {
{'fraction_non_alphanumeric': 0.13229957109864732, 'fraction_numerical': 0.00395908940943583, 'mean_word_length': 0.9970355731225297, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '474840', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1311, 'n_words': 278}