<commit_before>require 'spec_helper'
require 'vcr'

describe EmailHunter do
  let(:key) { "api key" }

  it 'has a version number' do
    expect(EmailHunter::VERSION).not_to be nil
  end

  it 'search API expect status \'success\'' do
  	VCR.use_cassette 'search API expect status \'success\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.search('google.com').status).to eq('success')
  	end
  end

  it 'search API expect results > 0' do
  	VCR.use_cassette 'search API expect results > 0' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.search('google.com').results).to be > 0
  	end
  end

  it 'search API expect offset == 0 with stripe.com domain' do
    VCR.use_cassette 'search API expect status \'success\'' do
      email_hunter = EmailHunter.new(key)
      expect(email_hunter.search('stripe.com').offset).to be == 0
    end
  end

  it 'exists API expect status \'success\'' do
  	VCR.use_cassette 'exists API expect status \'success\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.exist('<EMAIL>').status).to eq('success')
  	end
  end

  it 'exists API expect status \'true\'' do
  	VCR.use_cassette 'exists API expect status \'true\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.exist('<EMAIL>').exist).to eq(true)
  	end
  end

  it 'search API expect first email type == personal with stripe.com domain' do
    VCR.use_cassette 'search API expect first email type == personal with stripe.com domain' do
      email_hunter = EmailHunter.new(key)
      expect(email_hunter.search('stripe.com').emails.first[:type]).to be == "personal"
    end
  end

  it 'expect <EMAIL> API generate email' do
  	VCR.use_cassette 'expect <EMAIL> API generate email' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.generate('gmail.com', 'Davide', 'Santangelo').email).to eq('<EMAIL>')
  	end
  end
end<commit_msg>wrote rspec test for verify<commit_after>require 'spec_helper'
require 'vcr'

describe EmailHunter do
  let(:key) { "api key" }

  it 'has a version number' do
    expect(EmailHunter::VERSION).not_to be nil
  end

  it 'search API expect status \'success\'' do
  	VCR.use_cassette 'search API expect status \'success\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.search('google.com').status).to eq('success')
  	end
  end

  it 'search API expect results > 0' do
  	VCR.use_cassette 'search API expect results > 0' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.search('google.com').results).to be > 0
  	end
  end

  it 'search API expect offset == 0 with stripe.com domain' do
    VCR.use_cassette 'search API expect status \'success\'' do
      email_hunter = EmailHunter.new(key)
      expect(email_hunter.search('stripe.com').offset).to be == 0
    end
  end

  it 'exists API expect status \'success\'' do
  	VCR.use_cassette 'exists API expect status \'success\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.exist('<EMAIL>').status).to eq('success')
  	end
  end

  it 'exists API expect status \'true\'' do
  	VCR.use_cassette 'exists API expect status \'true\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.exist('<EMAIL>').exist).to eq(true)
  	end
  end

  it 'verify API expect status \'success\'' do
  	VCR.use_cassette 'verify API expect status \'success\'' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.verify('<EMAIL>').exist).to eq('success')
  	end
  end

  it 'search API expect first email type == personal with stripe.com domain' do
    VCR.use_cassette 'search API expect first email type == personal with stripe.com domain' do
      email_hunter = EmailHunter.new(key)
      expect(email_hunter.search('stripe.com').emails.first[:type]).to be == "personal"
    end
  end

  it 'expect <EMAIL> API generate email' do
  	VCR.use_cassette 'expect <EMAIL> API generate email' do
    	email_hunter = EmailHunter.new(key)
    	expect(email_hunter.generate('gmail.com', 'Davide', 'Santangelo').email).to eq('<EMAIL>')
  	end
  end
end
{'fraction_non_alphanumeric': 0.12112332112332112, 'fraction_numerical': 0.002442002442002442, 'mean_word_length': 3.5612472160356345, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 20, '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': '6115328', 'n_tokens_mistral': 1450, 'n_tokens_neox': 1395, 'n_words': 381}