<commit_before>require 'spec_helper.rb'

describe RSpec::Matchers, 'eql_file' do

  before( :each ) do
    @matcher = eql_file
    @path = 'spec/data/truth.txt'
    @truth = File.open( @path, 'rb' ) {|io| io.read }
  end

  it 'has a description' do
    @matcher.instance_variable_set( :@expected, @path )
    @matcher.description.should eql( "match the contents of #{@path}" )
  end

  it 'has a failure message for should' do
    expected = "expected that #{@truth} would match the contents of #{@path}"

    @matcher.instance_variable_set( :@expected, @path )
    @matcher.instance_variable_set( :@actual, @truth )
    @matcher.failure_message_for_should.should eql( expected )
  end

  it 'has a failure message for should not' do
     expected = "expected that #{@truth} would not match the contents of #{@path}"

     @matcher.instance_variable_set( :@expected, @path )
     @matcher.instance_variable_set( :@actual, @truth )
    @matcher.failure_message_for_should_not.should eql( expected )
  end

  it 'passes for a file that matches' do
    @truth.should eql_file( @path )
  end

  it 'fails for a file that is different' do
    'foobar'.should_not eql_file( @path )
  end

  it 'writes a tmp file that will pass' do
    tmp = @path + '.tmp'
    File.delete( tmp ) if File.exists?( tmp )

    File.exists?( tmp ).should be_false
    @truth.should eql_file( @path )
    File.exists?( tmp ).should be_true
  end

end<commit_msg>Fixing indenting weirdness<commit_after>require 'spec_helper.rb'

describe RSpec::Matchers, 'eql_file' do

  before( :each ) do
    @matcher = eql_file
    @path = 'spec/data/truth.txt'
    @truth = File.open( @path, 'rb' ) {|io| io.read }
  end

  it 'has a description' do
    @matcher.instance_variable_set( :@expected, @path )
    @matcher.description.should eql( "match the contents of #{@path}" )
  end

  it 'has a failure message for should' do
    expected = "expected that #{@truth} would match the contents of #{@path}"

    @matcher.instance_variable_set( :@expected, @path )
    @matcher.instance_variable_set( :@actual, @truth )
    @matcher.failure_message_for_should.should eql( expected )
  end

  it 'has a failure message for should not' do
    expected = "expected that #{@truth} would not match the contents of #{@path}"

    @matcher.instance_variable_set( :@expected, @path )
    @matcher.instance_variable_set( :@actual, @truth )
    @matcher.failure_message_for_should_not.should eql( expected )
  end

  it 'passes for a file that matches' do
    @truth.should eql_file( @path )
  end

  it 'fails for a file that is different' do
    'foobar'.should_not eql_file( @path )
  end

  it 'writes a tmp file that will pass' do
    tmp = @path + '.tmp'
    File.delete( tmp ) if File.exists?( tmp )

    File.exists?( tmp ).should be_false
    @truth.should eql_file( @path )
    File.exists?( tmp ).should be_true
  end

end
{'fraction_non_alphanumeric': 0.11866759195003469, 'fraction_numerical': 0.0, 'mean_word_length': 3.4906542056074765, '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': '6191546', 'n_tokens_mistral': 1008, 'n_tokens_neox': 973, 'n_words': 299}