Class: Jasmine::Headless::ReportMessage::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine/headless/report_message/spec.rb

Direct Known Subclasses

Fail, Pass

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(statement, file_info) ⇒ Spec

Returns a new instance of Spec.



13
14
15
# File 'lib/jasmine/headless/report_message/spec.rb', line 13

def initialize(statement, file_info)
  @statement, @file_info = statement, file_info
end

Instance Attribute Details

#file_infoObject (readonly)

Returns the value of attribute file_info.



11
12
13
# File 'lib/jasmine/headless/report_message/spec.rb', line 11

def file_info
  @file_info
end

#statementObject (readonly)

Returns the value of attribute statement.



11
12
13
# File 'lib/jasmine/headless/report_message/spec.rb', line 11

def statement
  @statement
end

Class Method Details

.new_from_parts(parts) ⇒ Object



4
5
6
7
8
# File 'lib/jasmine/headless/report_message/spec.rb', line 4

def new_from_parts(parts)
  file_info = parts.pop

  new(parts.join(' '), file_info)
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'lib/jasmine/headless/report_message/spec.rb', line 17

def ==(other)
  self.statement == other.statement && self.file_info == other.file_info
end

#filenameObject



21
22
23
24
25
26
27
# File 'lib/jasmine/headless/report_message/spec.rb', line 21

def filename
  if name = file_info.split(":").first
    name
  else
    nil
  end
end