Class: RSpec::Ci::Prettify::Annotation

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/ci/prettify/annotation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notification) ⇒ Annotation

Returns a new instance of Annotation.



6
7
8
9
# File 'lib/rspec/ci/prettify/annotation.rb', line 6

def initialize(notification)
    @notification = notification
    @example = notification.example
end

Instance Attribute Details

#exampleObject (readonly)

Returns the value of attribute example.



11
12
13
# File 'lib/rspec/ci/prettify/annotation.rb', line 11

def example
  @example
end

#notificationObject (readonly)

Returns the value of attribute notification.



11
12
13
# File 'lib/rspec/ci/prettify/annotation.rb', line 11

def notification
  @notification
end

Instance Method Details

#errorObject



17
18
19
20
# File 'lib/rspec/ci/prettify/annotation.rb', line 17

def error
    msg = notification.message_lines.join("\n")
    format_annotation_err(msg)
end

#fileObject



22
23
24
# File 'lib/rspec/ci/prettify/annotation.rb', line 22

def file
    File.realpath(location.split(':')[0]).sub(/\A#{github_workspace_file_path}#{File::SEPARATOR}/, '')
end

#lineObject



13
14
15
# File 'lib/rspec/ci/prettify/annotation.rb', line 13

def line
    location.split(':')[1]
end