Skip to content

Commit 3e79aeb

Browse files
Ensure every message is on a new line (#2)
1 parent 4c135a6 commit 3e79aeb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/rspec/github/formatter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ class Formatter < RSpec::Core::Formatters::BaseFormatter
1010

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

1616
def example_pending(pending)
1717
file, line = pending.example.location.split(':')
18-
output.puts "::warning file=#{file},line=#{line}::#{pending.example.full_description}"
18+
output.puts "\n::warning file=#{file},line=#{line}::#{pending.example.full_description}"
1919
end
2020
end
2121
end

spec/rspec/github/formatter_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

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

6061
it 'outputs the GitHub annotation formatted error' do
6162
is_expected.to eq <<~MESSAGE
63+
6264
::warning file=./spec/models/user_spec.rb,line=12::#{example.full_description}
6365
MESSAGE
6466
end

0 commit comments

Comments
 (0)