require 'eolclub_scraper/event_parser' describe EolclubScraper::EventParser do describe '#parse' do let(:parsed) { subject.parse(content) } it 'parses an Event from the supplied content' do expect( parsed.start_time ).to eq( Time.local(2013, 12, 9, 18, 0, 0) ) expect( parsed.end_time ).to eq( Time.local(2013, 12, 9, 23, 0, 0) ) end it 'provides the HTML description from the scraped page' do desc = parsed.description expect(desc).to include("Monthly Providence, RI hacknight.") expect(desc).to include("Our next meetup is") expect(desc).to include("@EOLclub") end end let(:content) { <<-EOF End of Line Club // Providence, RI hacknight

End of Line Club

Monthly Providence, RI hacknight. Code, design, and collaborate with other local developers to a backdrop of electronic music. Bring your laptop and a project to work on.

Our next meetup is Monday, December 9th from 6pm–11pm at Basics Group. Arrive whenever you can. Pizza and beer provided.

@EOLclub to get more info and RSVP.

EOF } end