jasmine-headless-webkit/lib/jasmine/headless/report_message/spec.rb

29 lines
535 B
Ruby
Raw Normal View History

module Jasmine::Headless::ReportMessage
class Spec
2011-12-29 23:37:23 +00:00
def self.new_from_parts(parts)
file_info = parts.pop
2011-12-29 23:37:23 +00:00
new(parts.join(' '), file_info)
end
attr_reader :statement, :file_info
def initialize(statement, file_info)
@statement, @file_info = statement, file_info
end
def ==(other)
self.statement == other.statement && self.file_info == other.file_info
end
def filename
if name = file_info.split(":").first
name
else
nil
end
end
end
end