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.
Files changed (46) hide show
  1. data/CHANGELOG.markdown +4 -0
  2. data/README.markdown +4 -10
  3. data/VERSION +1 -1
  4. data/features/exception_facade.feature +8 -8
  5. data/features/readme.feature +97 -0
  6. data/features/report_summary.feature +13 -13
  7. data/features/step_definitions/exception_facade.rb +1 -1
  8. data/features/step_definitions/{runner.rb → readme.rb} +2 -2
  9. data/features/step_definitions/report_summary.rb +1 -1
  10. data/features/step_definitions/reporter.rb +3 -3
  11. data/features/step_definitions/test.rb +129 -0
  12. data/features/test.feature +131 -0
  13. data/lib/specdown.rb +9 -15
  14. data/lib/specdown/command.rb +16 -11
  15. data/lib/specdown/event_handlers/command.rb +4 -0
  16. data/lib/specdown/event_handlers/readme.rb +7 -0
  17. data/lib/specdown/event_handlers/test.rb +8 -0
  18. data/lib/specdown/readme.rb +58 -0
  19. data/lib/specdown/{runner → readme}/exception_facade.rb +3 -3
  20. data/lib/specdown/readme/report_summary.rb +37 -0
  21. data/lib/specdown/readme/stats.rb +29 -0
  22. data/lib/specdown/reporter.rb +6 -6
  23. data/lib/specdown/reporters/color_terminal_reporter.rb +2 -2
  24. data/lib/specdown/reporters/terminal_reporter.rb +6 -6
  25. data/lib/specdown/reporters/text_reporter.rb +5 -5
  26. data/lib/specdown/specdown.rb +15 -4
  27. data/lib/specdown/templates/color_summary.erb +9 -11
  28. data/lib/specdown/templates/summary.erb +8 -10
  29. data/lib/specdown/test.rb +37 -0
  30. data/lib/specdown/tree.rb +0 -3
  31. metadata +40 -27
  32. data/features/runner.feature +0 -99
  33. data/lib/specdown/event_handlers/after_test.rb +0 -4
  34. data/lib/specdown/event_handlers/before_test.rb +0 -4
  35. data/lib/specdown/event_handlers/command_complete.rb +0 -4
  36. data/lib/specdown/event_handlers/run_complete.rb +0 -3
  37. data/lib/specdown/event_handlers/run_started.rb +0 -3
  38. data/lib/specdown/event_handlers/test_failed.rb +0 -3
  39. data/lib/specdown/event_handlers/test_passed.rb +0 -3
  40. data/lib/specdown/event_handlers/test_pending.rb +0 -3
  41. data/lib/specdown/event_handlers/test_undefined.rb +0 -3
  42. data/lib/specdown/hook.rb +0 -20
  43. data/lib/specdown/hooks.rb +0 -40
  44. data/lib/specdown/runner.rb +0 -61
  45. data/lib/specdown/runner/report_summary.rb +0 -37
  46. 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