<commit_before>require 'spec_helper'


describe RMathPlus do

  describe "is_prime?" do
    #before do
    #  config.expect_with(:rspec) { |c| c.syntax = :should }
    #end

    it "returns true when a number is prime" do
      (RMathPlus.is_prime?(3)).should == true
    end

    it "returns false when a number is not prime" do
      (RMathPlus.is_prime?(4)).should == false
    end

    #it "returns true when a big prime number is passed as param" do
    #  expect(RMathPlus.is_prime?(104729)).to == true
    #end

  end

end<commit_msg>Finished tests for first method<commit_after>require 'spec_helper'


describe RMathPlus do

  describe "is_prime?" do
    #before do
    #  config.expect_with(:rspec) { |c| c.syntax = :should }
    #end

    it "returns true when a number is prime" do
      (RMathPlus.is_prime?(3)).should == true
    end

    it "returns false when a number is not prime" do
      (RMathPlus.is_prime?(4)).should == false
    end

    it "returns true when a big prime number is passed as param" do
      (RMathPlus.is_prime?(104729)).should == true
    end

    it "executes faster when an array is passed as second parameter" do
      begin1 = Time.now
        (RMathPlus.is_prime?(50,[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]))
      finish1 = Time.now

      begin2 = Time.now
        (RMathPlus.is_prime?(50))
      finish2 = Time.now
      ((finish1 - begin1) > (finish2 - begin2)).should == true
    end

  end

end
{'fraction_non_alphanumeric': 0.1131815044858523, 'fraction_numerical': 0.037267080745341616, 'mean_word_length': 2.7760416666666665, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4642167', 'n_tokens_mistral': 521, 'n_tokens_neox': 490, 'n_words': 147}