<commit_before>require 'spec_helper'

describe "Init" do
    before :all do
        @json = '{"files":["index.html",".markwiki.cfg"],"css":{"dir_name":"css","files":["styles.css"]},"js":{"dir_name":"js","files":["scripts.js"]},"img":{"dir_name":"img","files":[]}}'
        @pjson = "{\n  \"files\": [\n    \"index.html\",\n    \".markwiki.cfg\"\n  ],\n  \"css\": {\n    \"dir_name\": \"css\",\n    \"files\": [\n      \"styles.css\"\n    ]\n  },\n  \"js\": {\n    \"dir_name\": \"js\",\n    \"files\": [\n      \"scripts.js\"\n    ]\n  },\n  \"img\": {\n    \"dir_name\": \"img\",\n    \"files\": [\n\n    ]\n  }\n}"
        @default_config = {
            "files" => ["index.html", ".markwiki.cfg"],
            "css" => {
                "dir_name" => "css",
                "files" => ["styles.css"]
            },
            "js" => {
                "dir_name" => "js",
                "files" => ["scripts.js"]
            },
            "img" => {
                "dir_name" => "img",
                "files" => []
            }
        }
        @config = {
            "files" => ["index.html", "404.html", ".markwiki.cfg"],
            "css" => {
                "dir_name" => "styles",
                "files" => ["styles.css"]
            },
            "js" => {
                "dir_name" => "scripts",
                "files" => ["scripts.js"]
            },
            "img" => {
                "dir_name" => "images",
                "files" => []
            }
        }
    end
    
    it "can generate a json configuration" do
        expect(Markwiki::Init.generate_json_config).to eq(@json)
    end

    it "can generate a pretty json configuration" do
        expect(Markwiki::Init.generate_pretty_json_config).to eq(@pjson)
    end

    it "can generate a default configuration hash" do
        expect(Markwiki::Init.default_config).to eq(@default_config)
    end

    it "can generate a configuration hash" do
        expect(Markwiki::Init.generate_config(
            files: ["index.html", "404.html"],
            css: "styles",
            js: "scripts",
            img: "images"
            )).to eq(@config)
    end
end
<commit_msg>Added default configuration file loading spec stub<commit_after>require 'spec_helper'

describe "Init" do
    before :all do
        @json = '{"files":["index.html",".markwiki.cfg"],"css":{"dir_name":"css","files":["styles.css"]},"js":{"dir_name":"js","files":["scripts.js"]},"img":{"dir_name":"img","files":[]}}'
        @pjson = "{\n  \"files\": [\n    \"index.html\",\n    \".markwiki.cfg\"\n  ],\n  \"css\": {\n    \"dir_name\": \"css\",\n    \"files\": [\n      \"styles.css\"\n    ]\n  },\n  \"js\": {\n    \"dir_name\": \"js\",\n    \"files\": [\n      \"scripts.js\"\n    ]\n  },\n  \"img\": {\n    \"dir_name\": \"img\",\n    \"files\": [\n\n    ]\n  }\n}"
        @default_config = {
            "files" => ["index.html", ".markwiki.cfg"],
            "css" => {
                "dir_name" => "css",
                "files" => ["styles.css"]
            },
            "js" => {
                "dir_name" => "js",
                "files" => ["scripts.js"]
            },
            "img" => {
                "dir_name" => "img",
                "files" => []
            }
        }
        @config = {
            "files" => ["index.html", "404.html", ".markwiki.cfg"],
            "css" => {
                "dir_name" => "styles",
                "files" => ["styles.css"]
            },
            "js" => {
                "dir_name" => "scripts",
                "files" => ["scripts.js"]
            },
            "img" => {
                "dir_name" => "images",
                "files" => []
            }
        }
    end
    
    it "can generate a json configuration" do
        expect(Markwiki::Init.generate_json_config).to eq(@json)
    end

    it "can generate a pretty json configuration" do
        expect(Markwiki::Init.generate_pretty_json_config).to eq(@pjson)
    end

    it "can generate a default configuration hash" do
        expect(Markwiki::Init.default_config).to eq(@default_config)
    end

    it "can generate a configuration hash" do
        expect(Markwiki::Init.generate_config(
            files: ["index.html", "404.html"],
            css: "styles",
            js: "scripts",
            img: "images"
            )).to eq(@config)
    end

    it "can load the default configuration file" do
        expect(Markwiki::Init.load_default_config).to eq(@default_config)
    end
end

{'fraction_non_alphanumeric': 0.20537300177619894, 'fraction_numerical': 0.0026642984014209592, 'mean_word_length': 1.5524079320113315, 'pattern_counts': {'":': 40, '<': 3, '<?xml version=': 0, '>': 43, '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': '2924347', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1365, 'n_words': 285}