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

describe 'when using libraries' do

  include RakeBuilderHelper

  before( :each ) do
    Rake::Task.clear
  end

  after( :each ) do
    Rake::Task[ 'clean' ].execute
  end

  it 'builds if libraries are found' do
    lambda do
      @project = cpp_task( :executable ) do |builder|
        builder.library_dependencies = [ 'gcc' ] # As we're using GCC, libgcc.a should always be present
      end
      Rake::Task[ 'build' ].invoke
    end.should_not raise_error
  end

  it 'fails to build if libraries are missing' do
    expect do
      @project = cpp_task( :executable ) do |builder|
        builder.library_dependencies = [ 'library_that_doesnt_exist' ]
      end
      Rake::Task[ 'build' ].invoke
    end.to raise_error( Rake::Builder::BuildFailure )
  end

end<commit_msg>Moved setup block out of expect block<commit_after>load File.dirname(__FILE__) + '/spec_helper.rb'

describe 'when using libraries' do

  include RakeBuilderHelper

  before( :each ) do
    Rake::Task.clear
  end

  after( :each ) do
    Rake::Task[ 'clean' ].execute
  end

  it 'builds if libraries are found' do
    lambda do
      @project = cpp_task( :executable ) do |builder|
        builder.library_dependencies = [ 'gcc' ] # As we're using GCC, libgcc.a should always be present
      end
      Rake::Task[ 'build' ].invoke
    end.should_not raise_error
  end

  it 'fails to build if libraries are missing' do
    @project = cpp_task( :executable ) do |builder|
      builder.library_dependencies = [ 'library_that_doesnt_exist' ]
    end

    expect do
      Rake::Task[ 'build' ].invoke
    end.                          to        raise_error( Rake::Builder::BuildFailure )
  end

end

{'fraction_non_alphanumeric': 0.09753298909925416, 'fraction_numerical': 0.0, 'mean_word_length': 2.8584070796460175, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4001243', 'n_tokens_mistral': 573, 'n_tokens_neox': 547, 'n_words': 168}