<commit_before>require 'helper'

# Tests that verify that on 1.8 versions of ruby, simplecov simply
# does not launch and does not cause errors on the way
class Test18FallBacks < Test::Unit::TestCase
  on_ruby '1.8' do
    should "return false when calling SimpleCov.start" do
      assert_equal false, SimpleCov.start
    end
    
    should "return false when calling SimpleCov.start with a block" do
      assert_equal false, SimpleCov.start { raise "Shouldn't reach this!?" }
    end
    
    should "return false when calling SimpleCov.configure with a block" do
      assert_equal false, SimpleCov.configure { raise "Shouldn't reach this!?" }
    end
  end
end
<commit_msg>Make sure adapter definitions go through on 1.8<commit_after>require 'helper'

# Tests that verify that on 1.8 versions of ruby, simplecov simply
# does not launch and does not cause errors on the way
#
# TODO: This should be expanded upon all methods that could potentially
# be called in a test/spec-helper simplecov config block
#
class Test18FallBacks < Test::Unit::TestCase
  on_ruby '1.8' do
    should "return false when calling SimpleCov.start" do
      assert_equal false, SimpleCov.start
    end
    
    should "return false when calling SimpleCov.start with a block" do
      assert_equal false, SimpleCov.start { raise "Shouldn't reach this!?" }
    end
    
    should "return false when calling SimpleCov.configure with a block" do
      assert_equal false, SimpleCov.configure { raise "Shouldn't reach this!?" }
    end
    
    should "allow to define an adapter" do
      begin
        SimpleCov.adapters.define 'testadapter' do
          add_filter '/config/'
        end
      rescue => err
        assert false, "Adapter definition should have been fine, but raised #{err}"
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.0660377358490566, 'fraction_numerical': 0.00776914539400666, 'mean_word_length': 3.1448275862068966, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '7028510', 'n_tokens_mistral': 518, 'n_tokens_neox': 504, 'n_words': 213}