turnip_formatter 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/Rakefile +13 -1
  4. data/lib/rspec/core/formatters/turnip_formatter/for_rspec2.rb +8 -13
  5. data/lib/rspec/core/formatters/turnip_formatter/for_rspec3.rb +8 -13
  6. data/lib/rspec/core/formatters/turnip_formatter.rb +6 -21
  7. data/lib/turnip_formatter/ext/turnip/rspec.rb +19 -77
  8. data/lib/turnip_formatter/printer/runtime_error.rb +7 -9
  9. data/lib/turnip_formatter/printer.rb +4 -4
  10. data/lib/turnip_formatter/scenario/base.rb +1 -5
  11. data/lib/turnip_formatter/scenario/failure.rb +24 -14
  12. data/lib/turnip_formatter/scenario/pending.rb +22 -16
  13. data/lib/turnip_formatter/step.rb +12 -6
  14. data/lib/turnip_formatter/step_template/base.rb +5 -1
  15. data/lib/turnip_formatter/step_template/exception.rb +14 -29
  16. data/lib/turnip_formatter/step_template/exception.slim +10 -0
  17. data/lib/turnip_formatter/step_template/source.rb +13 -11
  18. data/lib/turnip_formatter/template/exception.slim +8 -0
  19. data/lib/turnip_formatter/template/index.slim +86 -0
  20. data/lib/turnip_formatter/template/runtime_exception.slim +13 -0
  21. data/lib/turnip_formatter/template/scenario.slim +15 -0
  22. data/lib/turnip_formatter/template/step.slim +6 -0
  23. data/lib/turnip_formatter/template/step_multiline.slim +1 -0
  24. data/lib/turnip_formatter/template/step_outline.slim +6 -0
  25. data/lib/turnip_formatter/template/tab_feature_statistics.slim +18 -0
  26. data/lib/turnip_formatter/template/tab_speed_statistics.slim +16 -0
  27. data/lib/turnip_formatter/template/tab_tag_statistics.slim +18 -0
  28. data/lib/turnip_formatter/template/turnip_formatter.css +1 -0
  29. data/lib/turnip_formatter/template.rb +20 -35
  30. data/lib/turnip_formatter/version.rb +1 -1
  31. data/spec/support/example_helper.rb +16 -17
  32. data/spec/support/step_helper.rb +1 -1
  33. data/spec/turnip_formatter/printer/tab_speed_statistics_spec.rb +1 -1
  34. data/spec/turnip_formatter/scenario/failure_spec.rb +28 -1
  35. data/spec/turnip_formatter/scenario/pending_spec.rb +24 -1
  36. data/spec/turnip_formatter/step_template/exception_spec.rb +2 -2
  37. data/spec/turnip_formatter/template_spec.rb +114 -2
  38. data/turnip_formatter.gemspec +4 -5
  39. metadata +42 -54
  40. data/lib/turnip_formatter/template/exception.haml +0 -8
  41. data/lib/turnip_formatter/template/index.haml +0 -88
  42. data/lib/turnip_formatter/template/runtime_exception.haml +0 -13
  43. data/lib/turnip_formatter/template/scenario.haml +0 -14
  44. data/lib/turnip_formatter/template/step.haml +0 -6
  45. data/lib/turnip_formatter/template/step_multiline.haml +0 -1
  46. data/lib/turnip_formatter/template/step_outline.haml +0 -6
  47. data/lib/turnip_formatter/template/tab_feature_statistics.haml +0 -18
  48. data/lib/turnip_formatter/template/tab_speed_statistics.haml +0 -16
  49. data/lib/turnip_formatter/template/tab_tag_statistics.haml +0 -18
@@ -0,0 +1,86 @@
1
+ doctype 5
2
+ html
3
+ head
4
+ meta charset=("UTF-8")
5
+ title= TurnipFormatter::Template.project_name + ' report'
6
+
7
+ == TurnipFormatter::Template.render_stylesheet_links
8
+ style== TurnipFormatter::Template.render_stylesheet_codes
9
+
10
+ script src="http://code.jquery.com/jquery-1.11.0.min.js"
11
+ script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"
12
+ script src="http://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.17.0/jquery.tablesorter.min.js"
13
+
14
+ == TurnipFormatter::Template.render_javascript_links
15
+ script== TurnipFormatter::Template.render_javascript_codes
16
+
17
+ body
18
+ header#report
19
+ .container
20
+ .page-header
21
+ h1 = "#{TurnipFormatter::Template.project_name} Report"
22
+
23
+ section#status_display_switch
24
+ label for="passed_check"
25
+ input#passed_check type="checkbox"
26
+ | Passed
27
+ label for="failed_check"
28
+ input#failed_check type="checkbox" checked="checked"
29
+ | Failed
30
+ label for="pending_check"
31
+ input#pending_check type="checkbox"
32
+ | Pending
33
+
34
+ section.result
35
+ p = "#{scenarios.size} Scenario (#{failed_count} failed #{pending_count} pending)."
36
+ p = "Finished in #{total_time.to_s} sec"
37
+
38
+ #main.container role="main"
39
+ ul#statistics class="nav nav-tabs"
40
+ li.active
41
+ a data-toggle="tab" href="#steps-statistics"
42
+ | Steps
43
+ li
44
+ a data-toggle="tab" href="#speed-statistics"
45
+ | Speed Statistics
46
+ li
47
+ a data-toggle="tab" href="#feature-statistics"
48
+ | Feature Statistics
49
+ li
50
+ a data-toggle="tab" href="#tag-statistics"
51
+ | Tag Statistics
52
+
53
+ .tab-content
54
+ #steps-statistics class="tab-pane active"
55
+ .checkbox
56
+ label
57
+ input#scenario_display_check type="checkbox" checked="checked"
58
+ | Folding
59
+ #scenarios.panel-group
60
+ - scenarios.each do |s|
61
+ == ::TurnipFormatter::Printer::Scenario.print_out(s)
62
+
63
+ #feature-statistics.tab-pane
64
+ h4 The results for the feature:
65
+ == TurnipFormatter::Printer::TabFeatureStatistics.print_out(scenarios)
66
+
67
+ #tag-statistics.tab-pane
68
+ h4 The results for the tab:
69
+ == TurnipFormatter::Printer::TabTagStatistics.print_out(scenarios)
70
+
71
+ #speed-statistics.tab-pane
72
+ h4 Ranking of running time of each <strong>successfully</strong> scenario:
73
+ == TurnipFormatter::Printer::TabSpeedStatistics.print_out(scenarios)
74
+
75
+ footer
76
+ p
77
+ | Generated by &nbsp;
78
+ a href="https://rubygems.org/gems/turnip_formatter"
79
+ = "turnip_formatter #{TurnipFormatter::VERSION}"
80
+ p
81
+ | Powered by
82
+ a href="http://jquery.com/"
83
+ | &nbsp;jQuery 1.11.0
84
+ | &nbsp; and &nbsp;
85
+ a href="http://mottie.github.io/tablesorter/"
86
+ | tablesorter 2.17.0
@@ -0,0 +1,13 @@
1
+ section.exception
2
+ h1 TurnipFormatter RuntimeError
3
+ dl
4
+ == runtime_exception
5
+
6
+ dt Example Full Description
7
+ dd= example.metadata[:full_description]
8
+
9
+ == example_exception
10
+
11
+ - if example.pending
12
+ dt Example Pending description
13
+ dd= example.metadata[:description]
@@ -0,0 +1,15 @@
1
+ section class="scenario #{scenario.status}" id=scenario.id
2
+ div.scenario-title
3
+ span.permalink
4
+ a href="##{scenario.id}"
5
+ | &para;
6
+ span data-toggle="collapse" data-target="##{scenario.id}_body"
7
+ = "Scenario: #{scenario.name} Feature #{scenario.feature_info} at #{scenario.run_time} sec"
8
+ div class="panel-collapse collapse" id="#{scenario.id}_body"
9
+ div.panel-body
10
+ ul.tags
11
+ - scenario.tags.each do |tag|
12
+ li = "@#{tag}"
13
+ div.steps
14
+ - scenario.steps.each do |step|
15
+ == TurnipFormatter::Printer::Step.print_out(step)
@@ -0,0 +1,6 @@
1
+ div class="step #{step.status}"
2
+ .step-title= step.name
3
+ - if has_args_or_documents
4
+ div.step-body
5
+ == TurnipFormatter::Printer::StepExtraArgs.print_out(step.extra_args)
6
+ == step_docs
@@ -0,0 +1 @@
1
+ pre.multiline= lines
@@ -0,0 +1,6 @@
1
+ table.step_outline
2
+ - table.each do |tr|
3
+ tr
4
+ - tr.each do |td|
5
+ td
6
+ = td
@@ -0,0 +1,18 @@
1
+ table
2
+ thead
3
+ tr
4
+ th Feature
5
+ th Scenarios
6
+ th passed
7
+ th failed
8
+ th pending
9
+ th status
10
+ tbody
11
+ - analysis_results.each do |info|
12
+ tr
13
+ td= info.name
14
+ td= info.scenario_count
15
+ td= info.passed_count
16
+ td= info.failed_count
17
+ td= info.pending_count
18
+ td class=info.status = info.status
@@ -0,0 +1,16 @@
1
+ table
2
+ thead
3
+ tr
4
+ th Feature
5
+ th Scenario
6
+ th Duration
7
+ tbody
8
+ - analysis_results.each do |info|
9
+ tr
10
+ td
11
+ span= info.feature_name
12
+ td
13
+ a href="##{info.id}" = info.name
14
+ td
15
+ span= "#{info.run_time} sec"
16
+
@@ -0,0 +1,18 @@
1
+ table
2
+ thead
3
+ tr
4
+ th Tag
5
+ th Scenarios
6
+ th passed
7
+ th failed
8
+ th pending
9
+ th status
10
+ tbody
11
+ - analysis_results.each do |info|
12
+ tr
13
+ td= info.name
14
+ td= info.scenario_count
15
+ td= info.passed_count
16
+ td= info.failed_count
17
+ td= info.pending_count
18
+ td class=info.status = info.status