specdown 0.4.0.beta.1 → 0.4.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +4 -0
- data/README.markdown +4 -10
- data/VERSION +1 -1
- data/features/exception_facade.feature +8 -8
- data/features/readme.feature +97 -0
- data/features/report_summary.feature +13 -13
- data/features/step_definitions/exception_facade.rb +1 -1
- data/features/step_definitions/{runner.rb → readme.rb} +2 -2
- data/features/step_definitions/report_summary.rb +1 -1
- data/features/step_definitions/reporter.rb +3 -3
- data/features/step_definitions/test.rb +129 -0
- data/features/test.feature +131 -0
- data/lib/specdown.rb +9 -15
- data/lib/specdown/command.rb +16 -11
- data/lib/specdown/event_handlers/command.rb +4 -0
- data/lib/specdown/event_handlers/readme.rb +7 -0
- data/lib/specdown/event_handlers/test.rb +8 -0
- data/lib/specdown/readme.rb +58 -0
- data/lib/specdown/{runner → readme}/exception_facade.rb +3 -3
- data/lib/specdown/readme/report_summary.rb +37 -0
- data/lib/specdown/readme/stats.rb +29 -0
- data/lib/specdown/reporter.rb +6 -6
- data/lib/specdown/reporters/color_terminal_reporter.rb +2 -2
- data/lib/specdown/reporters/terminal_reporter.rb +6 -6
- data/lib/specdown/reporters/text_reporter.rb +5 -5
- data/lib/specdown/specdown.rb +15 -4
- data/lib/specdown/templates/color_summary.erb +9 -11
- data/lib/specdown/templates/summary.erb +8 -10
- data/lib/specdown/test.rb +37 -0
- data/lib/specdown/tree.rb +0 -3
- metadata +40 -27
- data/features/runner.feature +0 -99
- data/lib/specdown/event_handlers/after_test.rb +0 -4
- data/lib/specdown/event_handlers/before_test.rb +0 -4
- data/lib/specdown/event_handlers/command_complete.rb +0 -4
- data/lib/specdown/event_handlers/run_complete.rb +0 -3
- data/lib/specdown/event_handlers/run_started.rb +0 -3
- data/lib/specdown/event_handlers/test_failed.rb +0 -3
- data/lib/specdown/event_handlers/test_passed.rb +0 -3
- data/lib/specdown/event_handlers/test_pending.rb +0 -3
- data/lib/specdown/event_handlers/test_undefined.rb +0 -3
- data/lib/specdown/hook.rb +0 -20
- data/lib/specdown/hooks.rb +0 -40
- data/lib/specdown/runner.rb +0 -61
- data/lib/specdown/runner/report_summary.rb +0 -37
- data/lib/specdown/runner/stats.rb +0 -31
@@ -1,37 +0,0 @@
|
|
1
|
-
module Specdown
|
2
|
-
class ReportSummary
|
3
|
-
attr_reader :runners
|
4
|
-
|
5
|
-
def initialize(runners)
|
6
|
-
@runners = runners.respond_to?(:map) ? runners : [runners]
|
7
|
-
end
|
8
|
-
|
9
|
-
def num_markdowns
|
10
|
-
@num_markdowns ||= @runners.count
|
11
|
-
end
|
12
|
-
|
13
|
-
def num_tests
|
14
|
-
@num_tests ||= @runners.map(&:stats).map(&:tests).inject(0, &:+)
|
15
|
-
end
|
16
|
-
|
17
|
-
def num_pendings
|
18
|
-
@num_pendings ||= @runners.map(&:stats).map(&:pendings).inject(0, &:+)
|
19
|
-
end
|
20
|
-
|
21
|
-
def num_undefined
|
22
|
-
@num_undefined ||= @runners.map(&:stats).map(&:undefined).inject(0, &:+)
|
23
|
-
end
|
24
|
-
|
25
|
-
def num_failures
|
26
|
-
@num_failures ||= @runners.map(&:stats).map(&:failures).inject(0, &:+)
|
27
|
-
end
|
28
|
-
|
29
|
-
def num_successes
|
30
|
-
@num_successes ||= @runners.map(&:stats).map(&:successes).inject(0, &:+)
|
31
|
-
end
|
32
|
-
|
33
|
-
def exceptions
|
34
|
-
@exceptions ||= @runners.map(&:stats).map(&:exceptions).flatten
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Specdown
|
2
|
-
class Stats
|
3
|
-
attr_accessor :tests, :exceptions, :pending_exceptions, :undefined_implicits, :undefined_tests
|
4
|
-
attr_reader :runner
|
5
|
-
|
6
|
-
def initialize(source_runner=nil)
|
7
|
-
@runner = source_runner
|
8
|
-
@tests = 0
|
9
|
-
@exceptions = []
|
10
|
-
@pending_exceptions = []
|
11
|
-
@undefined_implicits = []
|
12
|
-
@undefined_tests = 0
|
13
|
-
end
|
14
|
-
|
15
|
-
def successes
|
16
|
-
@tests - failures - pendings - undefined_tests
|
17
|
-
end
|
18
|
-
|
19
|
-
def failures
|
20
|
-
@exceptions.count
|
21
|
-
end
|
22
|
-
|
23
|
-
def pendings
|
24
|
-
@pending_exceptions.count
|
25
|
-
end
|
26
|
-
|
27
|
-
def undefined
|
28
|
-
@undefined_implicits.count
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|