Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add red/green emoji to the title.

  • Loading branch information...
commit 553f98eca6bf680d8fcc91291bb436a17ac85c69 1 parent 3650158
@twe4ked authored
Showing with 9 additions and 5 deletions.
  1. +2 −2 lib/nc.rb
  2. +7 −3 spec/nc_spec.rb
View
4 lib/nc.rb
@@ -8,9 +8,9 @@ def dump_summary(duration, example_count, failure_count, pending_count)
body << summary_line(example_count, failure_count, pending_count)
title = if failure_count > 0
- "#{failure_count} failed example#{failure_count == 1 ? nil : 's'}"
+ "\u26D4 #{failure_count} failed example#{failure_count == 1 ? nil : 's'}"
else
- "Success"
+ "\u2705 Success"
end
say title, body.join("\n")
View
10 spec/nc_spec.rb
@@ -9,10 +9,14 @@
describe Nc do
let(:formatter) { Nc.new(StringIO.new) }
+ # emoji
+ let(:success) { "\u2705" }
+ let(:failure) { "\u26D4" }
+
it 'returns the summary' do
TerminalNotifier.should_receive(:notify).with(
"Finished in 0.0001 seconds\n3 examples, 1 failure, 1 pending",
- :title => "1 failed example"
+ :title => "#{failure} 1 failed example"
)
formatter.dump_summary(0.0001, 3, 1, 1)
@@ -21,7 +25,7 @@
it 'returns a failing notification' do
TerminalNotifier.should_receive(:notify).with(
"Finished in 0.0001 seconds\n1 example, 1 failure",
- :title => "1 failed example"
+ :title => "#{failure} 1 failed example"
)
formatter.dump_summary(0.0001, 1, 1, 0)
@@ -30,7 +34,7 @@
it 'returns a success notification' do
TerminalNotifier.should_receive(:notify).with(
"Finished in 0.0001 seconds\n1 example, 0 failures",
- :title => "Success"
+ :title => "#{success} Success"
)
formatter.dump_summary(0.0001, 1, 0, 0)
Please sign in to comment.
Something went wrong with that request. Please try again.