<commit_before># coding: utf-8
require "spec_helper"

describe "bin/lapidary" do
  before :all do
    @stdout_redirect = Lapidary::REDIRECT[:stdout]
    @stderr_redirect = Lapidary::REDIRECT[:stderr]
  end
  
  it "should create valid gem template" do
    work_dir = "#{ENV["HOME"]}/git"
    if ! FileTest.exists?(work_dir)
      Dir.mkdir(work_dir)
    end
    Dir.chdir(work_dir){
      if FileTest.exists?("lapidary_test")
        result = system("rm -rf lapidary_test")
        result.should be_true
      end
      system("ruby -I #{Lapidary::LAPIDARY_HOME}/lib #{Lapidary::LAPIDARY_HOME}/bin/lapidary --test lapidary_test #{@stdout_redirect} #{@stderr_redirect}").should be_true
      Dir.chdir("lapidary_test"){
        result = system("rake spec spec:rcov yard #{@stdout_redirect} #{@stderr_redirect}")
        result.should be_true
        
        FileTest.exists?("coverage").should be_true
        
        FileTest.exists?("doc").should be_true
        FileTest.exists?("doc/_index.html").should be_true

        File::Stat.new("./bin/lapidary_test").mode.should == 0100755
        
        system("ruby -I ./lib ./bin/lapidary_test").should be_true
      }
      <commit_msg>Use "~/.lapidary-spec-#{RUBY_VERSION}" for test directory<commit_after># coding: utf-8
require "spec_helper"

describe "bin/lapidary" do
  before :all do
    @stdout_redirect = Lapidary::REDIRECT[:stdout]
    @stderr_redirect = Lapidary::REDIRECT[:stderr]
  end
  
  it "should create valid gem template" do
    work_dir = "#{ENV["HOME"]}/.lapidary-spec-#{RUBY_VERSION}"
    if ! FileTest.exists?(work_dir)
      Dir.mkdir(work_dir)
    end
    Dir.chdir(work_dir){
      if FileTest.exists?("lapidary_test")
        result = system("rm -rf lapidary_test")
        result.should be_true
      end
      system("ruby -I #{Lapidary::LAPIDARY_HOME}/lib #{Lapidary::LAPIDARY_HOME}/bin/lapidary --test lapidary_test #{@stdout_redirect} #{@stderr_redirect}").should be_true
      Dir.chdir("lapidary_test"){
        result = system("rake spec spec:rcov yard #{@stdout_redirect} #{@stderr_redirect}")
        result.should be_true
        
        FileTest.exists?("coverage").should be_true
        
        FileTest.exists?("doc").should be_true
        FileTest.exists?("doc/_index.html").should be_true

        File::Stat.new("./bin/lapidary_test").mode.should == 0100755
        
        system("ruby -I ./lib ./bin/lapidary_test").should be_true
      }
      
{'fraction_non_alphanumeric': 0.13964883625969784, 'fraction_numerical': 0.006533278889342589, 'mean_word_length': 3.0833333333333335, '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': '4301015', 'n_tokens_mistral': 838, 'n_tokens_neox': 818, 'n_words': 146}