<commit_before>When /^I create a contact for the client named "([^\"]*)" with the following:$/ do |name, table|
  client = Then %Q{there should be a client with the name "#{name}"}
  contact = harvest_api.contacts.create(table.rows_hash.merge("client_id" => client.id))
  contact.first_name.should == table.rows_hash["first_name"]
end

Then /^there should be a contact for the client named "([^\"]*)" with an email address "([^\"]*)"$/ do |name, email|
  client = Then %Q{there should be a client with the name "#{name}"}
  
  contacts = harvest_api.contacts.all
  contact = contacts.detect {|c| c.email == email}
  contact.client_id.should == client.id
  
  contacts = harvest_api.contacts.all(client.id)
  contact2 = contacts.detect {|c| c.email == email}
  contact2.should == contact
end<commit_msg>Doing some reorganizing<commit_after>When 'I create a contact for the client named "$1" with the following:' do |name, table|
  client = Then %Q{there should be a client with the name "#{name}"}
  contact = harvest_api.contacts.create(table.rows_hash.merge("client_id" => client.id))
  contact.first_name.should == table.rows_hash["first_name"]
end

Then 'there should be a contact for the client named "$1" with an email address "$2"' do |name, email|
  client = Then %Q{there should be a client with the name "#{name}"}
  
  contacts = harvest_api.contacts.all
  contact = contacts.detect {|c| c.email == email}
  contact.client_id.should == client.id
  
  contacts = harvest_api.contacts.all(client.id)
  contact2 = contacts.detect {|c| c.email == email}
  contact2.should == contact
  contact
end

When 'I update the contact for the client named "$1" with the email address "$2" with the following:' do |name, email, table|
  pending
  contact = Then 'there should be a contact for the client named "#{name}" with an email address "#{email}"'
  harvest_api.contacts.update(contact.id, table.row_hashes)
end
{'fraction_non_alphanumeric': 0.13389121338912133, 'fraction_numerical': 0.004707112970711297, 'mean_word_length': 4.434659090909091, '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': '5444996', 'n_tokens_mistral': 604, 'n_tokens_neox': 605, 'n_words': 206}