2011-09-02 21:00:21 +00:00
|
|
|
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-09-02 21:00:21 +00:00
|
|
|
|
2011-12-29 23:37:23 +00:00
|
|
|
new(parts.join(' '), file_info)
|
2011-09-02 21:00:21 +00:00
|
|
|
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
|
2011-09-06 20:01:10 +00:00
|
|
|
|
|
|
|
def filename
|
2011-09-06 20:48:19 +00:00
|
|
|
if name = file_info.split(":").first
|
|
|
|
name
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2011-09-06 20:01:10 +00:00
|
|
|
end
|
2011-09-02 21:00:21 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|