Class: RSpec::Github::NotificationDecorator
- Inherits:
-
Object
- Object
- RSpec::Github::NotificationDecorator
- Defined in:
- lib/rspec/github/notification_decorator.rb
Constant Summary collapse
- ESCAPE_MAP =
{ '%' => '%25', "\n" => '%0A', "\r" => '%0D' }.freeze
Instance Method Summary collapse
- #annotation ⇒ Object
-
#initialize(notification) ⇒ NotificationDecorator
constructor
A new instance of NotificationDecorator.
- #line ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(notification) ⇒ NotificationDecorator
Returns a new instance of NotificationDecorator.
13 14 15 |
# File 'lib/rspec/github/notification_decorator.rb', line 13 def initialize(notification) @notification = notification end |
Instance Method Details
#annotation ⇒ Object
21 22 23 24 |
# File 'lib/rspec/github/notification_decorator.rb', line 21 def annotation "#{example.full_description}\n\n#{}" .gsub(Regexp.union(ESCAPE_MAP.keys), ESCAPE_MAP) end |
#line ⇒ Object
17 18 19 |
# File 'lib/rspec/github/notification_decorator.rb', line 17 def line example.location.split(':')[1] end |
#path ⇒ Object
26 27 28 29 |
# File 'lib/rspec/github/notification_decorator.rb', line 26 def path # TODO: use `delete_prefix` when dropping ruby 2.4 support File.realpath(raw_path).sub(/\A#{workspace}#{File::SEPARATOR}/, '') end |