<commit_before>require "spec_helper"
require "doattend/base"

describe Doattend::Participant do
	
	before(:each) do
		@doattend = Doattend::Base.new('EVENT_ID', 'API_KEY')
		sample_response = File.new(File.expand_path('../example.json', __FILE__))
		stub_request(:get, @doattend.url).to_return(:body => sample_response)
		@doattend.fetch		
	end

	it "should pluck all ticket numbers" do
		@doattend.participant.pluck("Ticket_Number").should eq ["326817", "325434", "324549", "324521", "323367", "322474", "322085", "320774", "319951", "319165", "318800"]
	end

	it "should return a valid particpant hash of the specified ticket" do
		@doattend.participant.find('326817').should be_kind_of Hash
	end

	it "should return" do
		@doattend.participant.find('316117').should be_nil
	end

end
<commit_msg>spec for counting number of male participants<commit_after>require "spec_helper"
require "doattend/base"

describe Doattend::Participant do
	
	before(:each) do
		@doattend = Doattend::Base.new('EVENT_ID', 'API_KEY')
		sample_response = File.new(File.expand_path('../example.json', __FILE__))
		stub_request(:get, @doattend.url).to_return(:body => sample_response)
		@doattend.fetch		
	end

	it "should pluck all ticket numbers" do
		@doattend.participant.pluck("Ticket_Number").should eq ["326817", "325434", "324549", "324521", "323367", "322474", "322085", "320774", "319951", "319165", "318800"]
	end

	it "should return a valid particpant hash of the specified ticket" do
		@doattend.participant.find('326817').should be_kind_of Hash
	end

	it "should return nil for an invalid ticket number" do
		@doattend.participant.find('316117').should be_nil
	end
	
	it "should return the number of occurrences who are male participants" do
		@doattend.participant.ascertain('Gender', 'Male').should eq 8
	end

end

{'fraction_non_alphanumeric': 0.1366906474820144, 'fraction_numerical': 0.08688433868289984, 'mean_word_length': 5.527075812274369, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3274365', 'n_tokens_mistral': 766, 'n_tokens_neox': 636, 'n_words': 159}