<commit_before>require 'spec_helper'

describe Rack::Blogengine::Document do
  before :all do
    @document = Rack::Blogengine::Document.new

    @document.title = 'testtitle'
    @document.path = '/test'
    @document.date = '20-20-2014'
    @document.html = '<html><h1>Test</h1></html>'
  end

  describe "#new" do
    it "should be an instance of Document" do
      @document.class.should eql Rack::Blogengine::Document
    end

    it "should have content when parsed in" do
      @document.title.should eql 'testtitle'
      @document.path.should eql '/test'
      @document.date.should eql '20-20-2014'
      @document.html.should eql '<html><h1>Test</h1></html>'
    end
  end

  describe "#to_hash" do
  	it "should return the right hash" do
  	  hashed = @document.to_hash

  	  hashed.key?(:path).should be_true
  	  hashed.key?(:html).should be_true
  	end
  end
end<commit_msg>added more rspec tests<commit_after>require 'spec_helper'

describe Rack::Blogengine::Document do
  before :all do
    @document = Rack::Blogengine::Document.new

    @document.title = 'testtitle'
    @document.path = '/test'
    @document.date = '20-20-2014'
    @document.html = '<html><h1>Test</h1></html>'
  end

  describe '#new' do
    it 'should be an instance of Document' do
      @document.class.should eql Rack::Blogengine::Document
    end

    it 'should have content when parsed in' do
      @document.title.should eql 'testtitle'
      @document.path.should eql '/test'
      @document.date.should eql '20-20-2014'
      @document.html.should eql '<html><h1>Test</h1></html>'
    end
  end

  describe '#to_hash' do
    it 'should return the right hash' do
      hashed = @document.to_hash

      hashed.key?(:path).should be_true
      hashed.key?(:html).should be_true
    end
  end
end
{'fraction_non_alphanumeric': 0.13058035714285715, 'fraction_numerical': 0.022321428571428572, 'mean_word_length': 3.084282460136674, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '6848679', 'n_tokens_mistral': 639, 'n_tokens_neox': 600, 'n_words': 152}