Skip to content

Commit

Permalink
Ensure every message is on a new line (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefSchenkelaars committed Aug 3, 2020
1 parent 4c135a6 commit 3e79aeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rspec/github/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class Formatter < RSpec::Core::Formatters::BaseFormatter

def example_failed(failure)
file, line = failure.example.location.split(':')
output.puts "::error file=#{file},line=#{line}::#{failure.message_lines.join('%0A')}"
output.puts "\n::error file=#{file},line=#{line}::#{failure.message_lines.join('%0A')}"
end

def example_pending(pending)
file, line = pending.example.location.split(':')
output.puts "::warning file=#{file},line=#{line}::#{pending.example.full_description}"
output.puts "\n::warning file=#{file},line=#{line}::#{pending.example.full_description}"
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions spec/rspec/github/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

it 'outputs the GitHub annotation formatted error' do
is_expected.to eq <<~MESSAGE
::error file=./spec/models/user_spec.rb,line=12::#{notification.message_lines.join('%0A')}
MESSAGE
end
Expand All @@ -59,6 +60,7 @@

it 'outputs the GitHub annotation formatted error' do
is_expected.to eq <<~MESSAGE
::warning file=./spec/models/user_spec.rb,line=12::#{example.full_description}
MESSAGE
end
Expand Down

0 comments on commit 3e79aeb

Please sign in to comment.