rspec_pretty_report 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,158 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>Rspec HTML Reports - Overview</title>
8
+
9
+ <!-- Bootstrap -->
10
+ <link href="resources/bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">
11
+ <link href="resources/bootstrap-3.2.0-dist/css/bootstrap-theme-yeti.min.css" rel="stylesheet">
12
+
13
+ <!--[if lt IE 9]>
14
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
15
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
16
+ <![endif]-->
17
+
18
+ <script src="resources/jquery-1.11.1.min.js"></script>
19
+ <script src="resources/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
20
+ <script src="resources/jscharts.js"></script>
21
+ <style>
22
+ * {
23
+ font-size: 14px;
24
+ }
25
+
26
+ <%= Rouge::Themes::Github.render(:scope => '.highlight') %>
27
+ </style>
28
+ </head>
29
+ <body>
30
+ <div class="container">
31
+
32
+ <div class="bs-docs-section clearfix">
33
+ <div class="row">
34
+ <div class="col-lg-12">
35
+
36
+ <div class="bs-component">
37
+ <div class="navbar navbar-default">
38
+ <div class="navbar-header">
39
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
40
+ <span class="icon-bar"></span>
41
+ <span class="icon-bar"></span>
42
+ <span class="icon-bar"></span>
43
+ </button>
44
+ <a class="navbar-brand" href="#">Rspec Reports</a>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="row">
53
+ <div class="col-lg-12">
54
+ <p class="text-center" style="font-size:2em;">Overview</p>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="row">
59
+
60
+ <div class="col-md-6">
61
+
62
+ <div class="panel panel-default">
63
+ <div class="panel-heading">Group Summary</div>
64
+ <div class="panel-body">
65
+ <span class="pull-right label label-primary"><%= @total_examples %> Examples</span>
66
+
67
+ <div id="specification_summary">Loading chart...</div>
68
+ </div>
69
+ </div>
70
+
71
+ </div>
72
+
73
+ <div class="col-md-6">
74
+
75
+ <div class="panel panel-default">
76
+ <div class="panel-heading">Duration Summary</div>
77
+ <div class="panel-body">
78
+ <span class="pull-right label label-primary">Finished in <%= @summary_duration %></span>
79
+
80
+ <div id="duration_summary">Loading chart...</div>
81
+ </div>
82
+ </div>
83
+
84
+ </div>
85
+
86
+ </div>
87
+
88
+ <div class="row">
89
+
90
+ <div class="col-lg-12">
91
+
92
+ <table class="table table-striped table-hover ">
93
+ <thead>
94
+ <tr>
95
+ <th>#</th>
96
+ <th>Group</th>
97
+ <th>Duration</th>
98
+ <th class="warning">Pending</th>
99
+ <th class="danger">Failed</th>
100
+ <th class="success">Passed</th>
101
+ <th>Status</th>
102
+ </tr>
103
+ </thead>
104
+ <tbody>
105
+ <% i = 1 %>
106
+ <% @overview.each do |group_name,group| %>
107
+ <tr>
108
+ <td><%= i %></td>
109
+ <td>
110
+ <a href="<%= group_name %>.html"><%= group[:group] %></a>
111
+ </td>
112
+ <td><%= group[:duration] %></td>
113
+ <td class="warning"><span><%= group[:pending].size %></span></td>
114
+ <td class="danger"><span><%= group[:failed].size %></span></td>
115
+ <td class="success"><span><%= group[:passed].size %></span></td>
116
+ <td><span class="label label-<%= group[:klass]%>"><%= group[:status] %></span></td>
117
+ </tr>
118
+ <% i+= 1%>
119
+ <% end %>
120
+ </tbody>
121
+ </table>
122
+
123
+ </div>
124
+ </div>
125
+
126
+ </div>
127
+
128
+ <script type="text/javascript">
129
+ var myChart = new JSChart('specification_summary', 'pie', '');
130
+ myChart.setDataArray([
131
+ ['Passed', <%= @passed %>],
132
+ ['Failed', <%= @failed %>],
133
+ ['Pending', <%= @pending %>]
134
+ ]);
135
+ myChart.colorize(['#8DC63F', '#ED1C24', '#F7941D']);
136
+ myChart.setSize(400, 300);
137
+ myChart.setPieRadius(95);
138
+ myChart.setTitle('');
139
+ myChart.setTitleColor('#505050');
140
+ myChart.setPieUnitsColor('#505050');
141
+ myChart.setPieValuesOffset(-15);
142
+ myChart.draw();
143
+
144
+ var myChart2 = new JSChart('duration_summary', 'line', '');
145
+ myChart2.setDataArray(<%= @durations %>);
146
+ myChart2.setSize(400, 300);
147
+ myChart2.setLineColor('#0070B8');
148
+ myChart2.setTitle('');
149
+ myChart2.setTitleFontSize(10);
150
+ myChart2.setAxisNameX('Examples');
151
+ myChart2.setAxisNameY('');
152
+ myChart2.setAxisValuesNumberX(1);
153
+ myChart2.draw();
154
+ </script>
155
+
156
+
157
+ </body>
158
+ </html>
@@ -0,0 +1,186 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>Rspec HTML Reports - <%= @title %></title>
8
+
9
+ <!-- Bootstrap -->
10
+ <link href="resources/bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">
11
+ <link href="resources/bootstrap-3.2.0-dist/css/bootstrap-theme-yeti.min.css" rel="stylesheet">
12
+
13
+ <!--[if lt IE 9]>
14
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
15
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
16
+ <![endif]-->
17
+
18
+ <script src="resources/jquery-1.11.1.min.js"></script>
19
+ <script src="resources/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
20
+ <script src="resources/jscharts.js"></script>
21
+ <style>
22
+ * {
23
+ font-size: 14px;
24
+ }
25
+
26
+ <%= Rouge::Themes::Github.render(:scope => '.highlight') %>
27
+ </style>
28
+ </head>
29
+ <body>
30
+ <div class="container">
31
+
32
+ <div class="bs-docs-section clearfix">
33
+ <div class="row">
34
+ <div class="col-lg-12">
35
+
36
+ <div class="bs-component">
37
+ <div class="navbar navbar-default">
38
+ <div class="navbar-header">
39
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
40
+ <span class="icon-bar"></span>
41
+ <span class="icon-bar"></span>
42
+ <span class="icon-bar"></span>
43
+ </button>
44
+ <a class="navbar-brand" href="#">Rspec Reports</a>
45
+ </div>
46
+
47
+ <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
48
+ <ul class="nav navbar-nav">
49
+ <li><a href="overview.html">Overview</a></li>
50
+ </ul>
51
+ </div>
52
+
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+ <div class="row">
60
+ <div class="col-lg-12">
61
+ <p class="text-center" style="font-size:2em;"><%= @title %></p>
62
+ </div>
63
+ </div>
64
+
65
+ <div class="row">
66
+
67
+ <div class="col-md-6">
68
+
69
+ <div class="panel panel-default">
70
+ <div class="panel-heading">Examples Summary</div>
71
+ <div class="panel-body">
72
+ <span class="pull-right label label-primary"><%= @examples.size %> Examples</span>
73
+
74
+ <div id="specification_summary">Loading chart...</div>
75
+ </div>
76
+ </div>
77
+
78
+ </div>
79
+
80
+ <div class="col-md-6">
81
+
82
+ <div class="panel panel-default">
83
+ <div class="panel-heading">Duration Summary</div>
84
+ <div class="panel-body">
85
+ <span class="pull-right label label-primary">Finished in <%= @summary_duration %></span>
86
+
87
+ <div id="duration_summary">Loading chart...</div>
88
+ </div>
89
+ </div>
90
+
91
+ </div>
92
+
93
+ </div>
94
+
95
+ <div class="row">
96
+
97
+ <div class="col-lg-12">
98
+
99
+ <table class="table table-striped table-hover ">
100
+ <thead>
101
+ <tr>
102
+ <th>#</th>
103
+ <th>Example</th>
104
+ <th>Duration</th>
105
+ <th>Status</th>
106
+ </tr>
107
+ </thead>
108
+ <tbody>
109
+ <% @examples.each_with_index do |example, i| %>
110
+ <tr>
111
+ <td><%= i+1 %></td>
112
+ <td>
113
+ <div>
114
+ <% if example.has_spec? %>
115
+ <div class="panel <%= example.klass('panel-') %>">
116
+ <div class="panel-heading">
117
+ <h3 class="panel-title"> <%= example.full_description %></h3>
118
+ </div>
119
+ <div class="panel-body">
120
+ <%= example.spec %>
121
+ </div>
122
+ </div>
123
+ <% else %>
124
+ <%= example.full_description %>
125
+ <% end %>
126
+ </div>
127
+ <div>
128
+ <% if example.has_exception? %>
129
+
130
+ <div class="panel panel-danger">
131
+ <div class="panel-heading">
132
+ <h3 class="panel-title"><%= example.exception.klass %></h3>
133
+ </div>
134
+ <div class="panel-body">
135
+ <%= example.exception.explanation %>
136
+ <h5><%= example.exception.backtrace_message %></h5>
137
+ <%= example.exception.highlighted_source %>
138
+ </div>
139
+ </div>
140
+
141
+ <% end %>
142
+ </div>
143
+ </td>
144
+ <td><%= example.duration %></td>
145
+ <td><span class="label <%= example.klass %>"><%= example.status %></span></td>
146
+ </tr>
147
+ <% end %>
148
+ </tbody>
149
+ </table>
150
+
151
+ </div>
152
+ </div>
153
+
154
+ </div>
155
+
156
+ <script type="text/javascript">
157
+ var myChart = new JSChart('specification_summary', 'pie', '');
158
+ myChart.setDataArray([
159
+ ['Passed', <%= @passed %>],
160
+ ['Failed', <%= @failed %>],
161
+ ['Pending', <%= @pending %>]
162
+ ]);
163
+ myChart.colorize(['#8DC63F', '#ED1C24', '#F7941D']);
164
+ myChart.setSize(400, 300);
165
+ myChart.setPieRadius(95);
166
+ myChart.setTitle('');
167
+ myChart.setTitleColor('#505050');
168
+ myChart.setPieUnitsColor('#505050');
169
+ myChart.setPieValuesOffset(-15);
170
+ myChart.draw();
171
+
172
+ var myChart2 = new JSChart('duration_summary', 'line', '');
173
+ myChart2.setDataArray(<%= @durations %>);
174
+ myChart2.setSize(400, 300);
175
+ myChart2.setLineColor('#0070B8');
176
+ myChart2.setTitle('');
177
+ myChart2.setTitleFontSize(10);
178
+ myChart2.setAxisNameX('Examples');
179
+ myChart2.setAxisNameY('');
180
+ myChart2.setAxisValuesNumberX(1);
181
+ myChart2.draw();
182
+ </script>
183
+
184
+
185
+ </body>
186
+ </html>
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec_pretty_report
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tim sheng
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-10-15 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A more pretty html report for rspec
15
+ email: 278570038@qq.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/rspec_pretty_report.rb
21
+ - resources/bootstrap-3.2.0-dist/css/bootstrap-theme-yeti.min.css
22
+ - resources/bootstrap-3.2.0-dist/css/bootstrap.min.css
23
+ - resources/bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.eot
24
+ - resources/bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.svg
25
+ - resources/bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.ttf
26
+ - resources/bootstrap-3.2.0-dist/fonts/glyphicons-halflings-regular.woff
27
+ - resources/bootstrap-3.2.0-dist/js/bootstrap.min.js
28
+ - resources/jquery-1.11.1.min.js
29
+ - resources/jscharts.js
30
+ - rspec_pretty_report.gemspec
31
+ - spec/penders_spec.rb
32
+ - spec/rspec_pretty_report_spec.rb
33
+ - spec/test2_spec.rb
34
+ - templates/overview.erb
35
+ - templates/report.erb
36
+ homepage: http://github.com/timsheng/rspec_pretty_report
37
+ licenses: []
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 1.8.28
57
+ signing_key:
58
+ specification_version: 3
59
+ summary: Rspec custom formatter to generate pretty html results
60
+ test_files: []