<commit_before><commit_msg>Added a Spec File for Utility<commit_after>
require 'utility'

describe Utility, "provides utilities" do

    before(:each) do
        @arry = [
            Webpage.new('/'),
            Webpage.new('/about'),
            Webpage.new('/contact'),
            Webpage.new('/about/contract'),
        ]
    end

    it "can find links as strings" do
        Utility.has_link?(@arry, '/').should be_true
        Utility.has_link?(@arry, '/about').should be_true
        Utility.has_link?(@arry, '/contact').should be_true
        Utility.has_link?(@arry, '/about/contract').should be_true
        
        Utility.has_link?(@arry, '/friends').should be_false
        Utility.has_link?(@arry, '/about/friends').should be_false
    end

    it "can find links as pages" do

        Utility.has_link?(@arry, Webpage.new('/')).should be_true
        Utility.has_link?(@arry, Webpage.new('/about')).should be_true
        Utility.has_link?(@arry, Webpage.new('/contact')).should be_true
        Utility.has_link?(@arry, Webpage.new('/about/contract')).should be_true

        Utility.has_link?(@arry, Webpage.new('/friends')).should be_false
        Utility.has_link?(@arry, Webpage.new('/about/friends')).should be_false
    end
end
{'fraction_non_alphanumeric': 0.15415335463258786, 'fraction_numerical': 0.0, 'mean_word_length': 2.785498489425982, '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': '74008', 'n_tokens_mistral': 397, 'n_tokens_neox': 402, 'n_words': 74}