<commit_before>require File.dirname(__FILE__) + '/../../spec_helper'

describe "File.identical?" do  
  before :each do    
    @file1 = 'test.txt'
    @file2 = 'test2.txt'
    @file3 = 'test.lnk'
    File.delete(@file3) if File.exists?(@file3)
     
    File.open(@file1,"w+") { |f| f.puts "file1" }
    File.open(@file2,"w+") { |f| f.puts "file2" } 
    File.link(@file1, @file3)
  end
  
  after :each do          
    File.unlink(@file3)  
    File.delete(@file1) if File.exists?(@file1)    
    File.delete(@file2) if File.exists?(@file2)     
    @file1 = nil
    @file1 = nil
    @file1 = nil
  end

  it "return a Boolean class" do 
    File.identical?(@file1, @file2).class.should == FalseClass
    File.identical?(@file1, @file1).class.should == TrueClass
  end

  it "return true if they are identical" do
    File.identical?(@file1, @file1).should == true
    File.identical?(@file1, @file2).should == false
    File.identical?(@file1, @file3).should == true
  end

  it "raise an exception if the arguments are the wrong type or of incorrect number" do<commit_msg>Guard File.(un)link for jruby.<commit_after>require File.dirname(__FILE__) + '/../../spec_helper'

describe "File.identical?" do  
  before :each do    
    @file1 = 'test.txt'
    @file2 = 'test2.txt'
    @file3 = 'test.lnk'
    File.delete(@file3) if File.exists?(@file3)
     
    File.open(@file1,"w+") { |f| f.puts "file1" }
    File.open(@file2,"w+") { |f| f.puts "file2" }
    compliant :mri, :rubinius do
      File.link(@file1, @file3)
    end
  end
  
  after :each do
    compliant :mri, :rubinius do
      File.unlink(@file3)
    end
    File.delete(@file1) if File.exists?(@file1)    
    File.delete(@file2) if File.exists?(@file2)     
    @file1 = nil
    @file1 = nil
    @file1 = nil
  end

  it "return a Boolean class" do 
    File.identical?(@file1, @file2).class.should == FalseClass
    File.identical?(@file1, @file1).class.should == TrueClass
  end

  it "return true if they are identical" do
    File.identical?(@file1, @file1).should == true
    File.identical?(@file1, @file2).should == false
    File.identical?(@file1, @file3).should == true
  end

  it "raise an exception if the arguments are the wrong type or of incorrect number" do
{'fraction_non_alphanumeric': 0.15418894830659535, 'fraction_numerical': 0.026737967914438502, 'mean_word_length': 2.9043478260869566, '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': '1861337', 'n_tokens_mistral': 825, 'n_tokens_neox': 812, 'n_words': 198}