<commit_before>'use strict';

// Getting rid of jshint warnings (the yellow lines and exclaimation points are annoying)
var jasmine = jasmine, describe = describe, it = it, moment = moment, expect = expect, beforeEach = beforeEach;


// TOTEST:
// Export Rules
// Repeats function

var startDate = "01/01/2013";
var endDate = "01/01/2014";

describe("Creating a recurring moment", function() {

    var nowMoment = moment();
    var nowDate = nowMoment.format("L");


    it("from moment constructor, with options parameter - moment.recur(options)", function() {
        var recur = moment.recur({ start:startDate, end:endDate });
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment constructor, with start parameter only - moment.recur(start)", function() {
        var recur = moment.recur(startDate);
        expect(recur.start.format("L")).toBe(startDate);
    });

    it("from moment constructor, with start and end parameters - moment.recur(start, end)", function() {
        var recur = moment.recur(startDate, endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with options parameter - moment().recur(options)", function() {
        var recur = moment().recur({ start:startDate, end:endDate });
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with start and end parameters - moment().recur(start, end)", function() {
        var recur = moment().recur(startDate, endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with starting moment and end parameter - moment(start).recur(end)", function() {
        var recur = moment(startDate).recur(endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, starting now, with end parameter  - moment().recur(end)", function() {
        var recur = nowMoment.recur(endDate);
        expect(recur.start.format("L")).toBe(nowDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, starting now - moment().recur()", function() {
        var recur = nowMoment.recur();
        expect(recur.start.format("L")).toBe(nowDate);
    });
});

describe("Setting", function() {
    var recur;

    beforeEach(function() {
        recur = moment().recur();
    });

    it("'start' should be getable/setable with startDate()", function() {
        recur.startDate(startDate);
        expect(recur.startDate().format("L")).toBe(startDate);
    });

    it("'end' should be getable/setable with endDate()", function() {
        recur.endDate(endDate);
        expect(recur.endDate().format("L")).toBe(endDate);
    });<commit_msg>Jasmine now tests for ability to construct from moment objects (and fails)<commit_after>'use strict';

// Getting rid of jshint warnings (the yellow lines and exclaimation points are annoying)
var jasmine = jasmine, describe = describe, it = it, moment = moment, expect = expect, beforeEach = beforeEach;


// TOTEST:
// Export Rules
// Repeats function

var startDate = "01/01/2013";
var endDate = "01/01/2014";

describe("Creating a recurring moment", function() {

    var nowMoment = moment();
    var nowDate = nowMoment.format("L");


    it("from moment constructor, with options parameter - moment.recur(options)", function() {
        var recur = moment.recur({ start:startDate, end:endDate });
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment constructor, with start parameter only - moment.recur(start)", function() {
        var recur = moment.recur(startDate);
        expect(recur.start.format("L")).toBe(startDate);
    });

    it("from moment constructor, with start and end parameters - moment.recur(start, end)", function() {
        var recur = moment.recur(startDate, endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with options parameter - moment().recur(options)", function() {
        var recur = moment().recur({ start:startDate, end:endDate });
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with start and end parameters - moment().recur(start, end)", function() {
        var recur = moment().recur(startDate, endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, with starting moment and end parameter - moment(start).recur(end)", function() {
        var recur = moment(startDate).recur(endDate);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, starting now, with end parameter  - moment().recur(end)", function() {
        var recur = nowMoment.recur(endDate);
        expect(recur.start.format("L")).toBe(nowDate);
        expect(recur.end.format("L")).toBe(endDate);
    });

    it("from moment function, starting now - moment().recur()", function() {
        var recur = nowMoment.recur();
        expect(recur.start.format("L")).toBe(nowDate);
    });

    it("from moment function, with starting moment and end parameter, which is a moment object - moment(start).recur(end)", function() {
        var startMoment = moment(startDate);
        var endMoment = moment(endDate);
        var recur = moment(startMoment).recur(endMoment);
        expect(recur.start.format("L")).toBe(startDate);
        expect(recur.end.format("L")).toBe(endDate);
    });
});

describe("Setting", function() {
    var recur;

    beforeEach(function() {
        recur = moment().recur();
    });

    it("'start' should be getable/setable with startDate()", function() {
        recur.startDate(startDate);
        expect(recur.startDate().format("L")).toBe(startDate);
    });

    it("'end' should be getable/setable with endDate()", function() {
        recur.endDate(endDate);
        expect(recur.endDate().format("L")).toBe(endDate);
    });
{'fraction_non_alphanumeric': 0.16612679315131884, 'fraction_numerical': 0.0049359864260373285, 'mean_word_length': 3.4502402196293755, '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': '6699123', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1927, 'n_words': 426}