guard-rspec 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.rdoc +55 -33
- data/lib/guard/rspec.rb +9 -8
- data/lib/guard/rspec.rbc +659 -0
- data/lib/guard/rspec/formatter.rb +17 -6
- data/lib/guard/rspec/formatters/{default_spec.rb → notification_rspec.rb} +5 -4
- data/lib/guard/rspec/formatters/{default_rspec.rb → notification_spec.rb} +5 -6
- data/lib/guard/rspec/inspector.rb +20 -20
- data/lib/guard/rspec/inspector.rbc +1143 -0
- data/lib/guard/rspec/runner.rb +37 -27
- data/lib/guard/rspec/runner.rbc +2095 -0
- data/lib/guard/rspec/templates/Guardfile +12 -10
- data/lib/guard/rspec/version.rb +2 -2
- data/lib/guard/rspec/version.rbc +203 -0
- metadata +89 -86
- data/lib/guard/rspec/formatters/instafail_rspec.rb +0 -33
- data/lib/guard/rspec/formatters/instafail_spec.rb +0 -35
@@ -1,33 +0,0 @@
|
|
1
|
-
# Inspired from https://github.com/grosser/rspec-instafail/blob/master/lib/rspec/instafail.rb
|
2
|
-
require "#{File.dirname(__FILE__)}/../formatter"
|
3
|
-
require 'rspec/core/formatters/progress_formatter'
|
4
|
-
|
5
|
-
class InstafailRSpec < RSpec::Core::Formatters::ProgressFormatter
|
6
|
-
include Formatter
|
7
|
-
|
8
|
-
def dump_summary(duration, total, failures, pending)
|
9
|
-
super # needed to keep progress formatter
|
10
|
-
|
11
|
-
message = guard_message(total, failures, pending, duration)
|
12
|
-
image = guard_image(failures, pending)
|
13
|
-
notify(message, image)
|
14
|
-
end
|
15
|
-
|
16
|
-
def example_failed(example)
|
17
|
-
@counter ||= 0
|
18
|
-
@counter += 1
|
19
|
-
result = example.metadata[:execution_result]
|
20
|
-
exception = result[:exception_encountered] || result[:exception] # rspec 2.0 || rspec 2.2
|
21
|
-
short_padding = ' '
|
22
|
-
padding = ' '
|
23
|
-
output.puts
|
24
|
-
output.puts "#{short_padding}#{@counter}) #{example.full_description}"
|
25
|
-
output.puts "#{padding}#{red("Failure/Error:")} #{red(read_failed_line(exception, example).strip)}"
|
26
|
-
output.puts "#{padding}#{red(exception)}"
|
27
|
-
format_backtrace(exception.backtrace, example).each do |backtrace_info|
|
28
|
-
output.puts grey("#{padding}# #{backtrace_info}")
|
29
|
-
end
|
30
|
-
output.flush
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# Inspired from https://github.com/grosser/rspec-instafail/blob/master/lib/rspec/instafail.rb
|
2
|
-
require "#{File.dirname(__FILE__)}/../formatter"
|
3
|
-
require 'spec/runner/formatter/progress_bar_formatter'
|
4
|
-
|
5
|
-
class InstafailSpec < Spec::Runner::Formatter::ProgressBarFormatter
|
6
|
-
include Formatter
|
7
|
-
|
8
|
-
def dump_summary(duration, total, failures, pending)
|
9
|
-
message = guard_message(total, failures, pending, duration)
|
10
|
-
image = guard_image(failures, pending)
|
11
|
-
notify(message, image)
|
12
|
-
end
|
13
|
-
|
14
|
-
def example_failed(example, counter, failure)
|
15
|
-
short_padding = ' '
|
16
|
-
padding = ' '
|
17
|
-
|
18
|
-
output.puts
|
19
|
-
output.puts red("#{short_padding}#{counter}) #{example_group.description} #{example.description}")
|
20
|
-
output.puts "#{padding}#{red(failure.exception)}"
|
21
|
-
|
22
|
-
format_backtrace(failure.exception.backtrace).each do |backtrace_info|
|
23
|
-
output.puts insta_gray("#{padding}# #{backtrace_info.strip}")
|
24
|
-
end
|
25
|
-
|
26
|
-
output.flush
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
# there is a gray() that returns nil, so we use our own...
|
32
|
-
def insta_gray(text)
|
33
|
-
colour(text, "\e[90m")
|
34
|
-
end
|
35
|
-
end
|