<commit_before>$LOAD_PATH << File.join(File.dirname(__FILE__), "lib")

require 'bundler'
Bundler.require :test

require 'memetron'

def test_meme(meme)

  describe meme do

    # test positive examples
    meme.positive_examples.each do |positive, ret|
      it "should match \"#{positive}\"" do
        if ret
          meme.match(positive).should == ret
        else
          meme.match(positive).should_not be_false
        end
      end
    end

    # test negative examples
    unless meme.negative_examples.nil?
      meme.negative_examples.each do |negative|
        it "should not match \"#{negative}\"" do
          meme.match(negative).should be_false
        end
      end
    end
  end

end<commit_msg>updated to new rspec syntax for #4<commit_after>$LOAD_PATH << File.join(File.dirname(__FILE__), "lib")

require 'bundler'
Bundler.require :test

require 'memetron'

def test_meme(meme)

  describe meme do

    # test positive examples
    meme.positive_examples.each do |positive, ret|
      it "should match \"#{positive}\"" do
        if ret
          expect(meme.match(positive)).to eq(ret)
        else
          expect(meme.match(positive)).to eq(false)
        end
      end
    end

    # test negative examples
    unless meme.negative_examples.nil?
      meme.negative_examples.each do |negative|
        it "should not match \"#{negative}\"" do
          expect(meme.match(negative)).to eq(false)
        end
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.10191518467852258, 'fraction_numerical': 0.0006839945280437756, 'mean_word_length': 2.4668246445497632, 'pattern_counts': {'":': 0, '<': 7, '<?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': '191401', 'n_tokens_mistral': 473, 'n_tokens_neox': 452, 'n_words': 119}