Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (23 sloc) 1.02 kB
require 'spec_helper'
describe Parser do
it "should parse xml-based messages" do
collection = LogCollection.new
parser = ColloquyParser.new(collection)
colloquy_data = File.open("spec/fixtures/sample.colloquyTranscript") {|f| f.read}
parser.parse(StringIO.new(colloquy_data))
collection.senders.keys.length.should == 2
collection.entries.length.should == 11
collection.entries.first.content.should == "what?"
collection.entries.last.content.should == "JohnSmith disconnected from the server."
end
it "should parse line-based messages" do
collection = LogCollection.new
parser = IrciiParser.new(collection)
ircii_data = File.open("spec/fixtures/ircii.log") {|f| f.read}
parser.parse(StringIO.new(ircii_data))
collection.senders.keys.length.should == 9
collection.entries.length.should == 28
collection.entries.first.content.should == "has joined #letstalk"
collection.entries.last.content.should == "fudgeing madness"
end
end
Jump to Line
Something went wrong with that request. Please try again.