Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require File.dirname(__FILE__) + '/../test_helper'
class ParserTests < Test::Unit::TestCase
should_parse_leads "from an html file" do
@parser = LeadCapturer::Parser.new(File.read("email.html"))
end
should_parse_leads "with duplicate identifiers" do
@html = <<-eohtml
<html>
<head/>
<body>
<p class="AZBoxB">
<a href="../cfm/onclick.cfm?adref=B0315&webaddress=http%3A%2F%2Fwww.abslpower.com&name=ABSL%20Power%20Solutions%20Limited" target="_blank"><img class="FloatR" src="../logos/bl2z0315.gif" border=0> <img class="FloatR" src="../images/adsbutton.gif" border="0"> </a>
<a href="../cfm/onclick.cfm?adref=B0315&webaddress=..%2Fbd%2Dcat35%2Fc350104.cfm&name=ABSL%20Power%20Solutions%20Limited" target="_blank"><img class="FloatR" src="../images/bdecbutton.jpg" alt="Portable power systems" border=0></a> <a href="../cfm/onclick.cfm?adref=B0315&webaddress=http%3A%2F%2Fwww.abslpower.com&name=ABSL%20Power%20Solutions%20Limited" name="YABSPOW" target="_blank"><span class="CNameBold">ABSL Power Solutions Ltd</span></a>
<b>Abingdon</b>, F5 Culham Science Centre, Abingdon, Oxfordshire, OX14 3ED, United Kingdom
<br><i>Tel:</i> +44 (0)1865 408761<br><i>Fax:</i> +44 (0)1865 408770<br><i>email:</i> <a href="../cfm/onclickmail.cfm?adref=B0315&webaddress=mailto%3Aenquiries%40abslpower.com%3Fbcc%3DRefBDB3483%26lt%3Bsales%40bdec.co.uk%26gt%3B%26amp%3Bsubject%3DEnquiry%20from%20www.bdec%2Donline.com&name=ABSL%20Power%20Solutions%20Limited">enquiries@abslpower.com</a><br><i>Website:</i> <a href="../cfm/onclick.cfm?adref=B0315&webaddress=http%3A%2F%2Fwww.abslpower.com&name=ABSL%20Power%20Solutions%20Limited" target="_blank">www.abslpower.com</a><br>9001:2000<br><i>Chief Operating Officer:</i> John Burdett<br><i>General Manager - Power:</i> Mike Halliday<br><i>Finance Director:</i> Catherine Murray<br><i>Procurement Manager:</i> Sharon Douglas
<br><span class="BI">Key Products and Services:</span> Advanced battery systems (rechargeable and primary systems for defence), lithium-ion cells and batteries for military applications, modular and custom battery chargers, military batteries (wide range) and Bowman batteries and chargers, complete soldier modernisation portable power systems. ABSL also supplies the XX25 reformed methanol fuel cell (RMFC) through partnership with UltraCell Corporation.
<br><span class="BI">NATO Supply Classifications:</span> Space Vehicle Components; Generators and Generator Sets, Electrical; Fuel Cell Power Units, Components, and Accessories; Batteries, Nonrechargeable; Batteries, Rechargeable; Miscellaneous Electric Power and Distribution Equipment.
<br><span class="BI">Service Classifications:</span> <i>Research, development and test services</i>-Test facilities service<i>; Manufacturing services</i>-Bespoke design services.
<br><span class="BI">Divisions/Branches-</span>
<br><b>Abingdon</b>, F5 Culham Science Centre, Abingdon, Oxfordshire, OX14 3ED, United Kingdom, <i>Tel:</i> +44 (0)1865 408761, <i>Fax:</i> +44 (0)1865 408770, <i>Business Development Manager - Defence:</i> Peter Barry, <i>General Manager - Space Products:</i> Nick Russel, <i>General Manager - Power Products:</i> Mike Halliday</span>
</p>
</body>
</html>
eohtml
@parser = LeadCapturer::Parser.new(@html)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.