rspec_yah_formatter 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fadff7e240dc6674f7d356501e47e53aee9d91d2
4
- data.tar.gz: 2a76d915da277a119c1262d6c56df1b767aa20e9
3
+ metadata.gz: 1a7bad1267c438124ef01fd2825113cea0a8deaa
4
+ data.tar.gz: 8dd20d5b5dd1eb7642fc9b04ab146c48bf44bb5a
5
5
  SHA512:
6
- metadata.gz: 876f4f04bd416fc7eb1b93fdeef5b53fdce0094862d8db5bfbcdf3f31d4bbaf8dcac6c6fcb1402b3dadf84150902ae94b7f6f65492edb066bda906f06c7e47c3
7
- data.tar.gz: d258630cb6f0f65c8e9b62c9b7f2ea02798e65571073a167a457365d4bd9d4d87324471766b1ce05e884eae28d40a402d96c72c10e76d0c5803de998a68ab9a1
6
+ metadata.gz: 021cd492d0e39a275e2b53232d143b58ba79cf391a6bdf8d9faf2eea10fbdff6592c97bcdb348c7e3527eb46d6b3882eeb72b2c6cecfc5ca6093a422a6d527c0
7
+ data.tar.gz: a67c55a7478b6bd70aad82c57d2739f7324c929e2b17bd883835a15506deb1313bd0764eb58e9154cf010f04f979d330d84a05ce495fe0e172d1c5a04aa16b66
data/Rakefile CHANGED
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
17
17
  gem.name = "rspec_yah_formatter"
18
18
  gem.homepage = "http://github.com/dgmora/rspec_yah_formatter"
19
19
  gem.license = "MIT"
20
- gem.summary = %Q{Rspec custom formatter to generate pretty html results}
21
- gem.description = %Q{Rspec custom formatter to generate pretty html results}
20
+ gem.summary = %Q{Rspec html formatter to generate pretty results with images}
21
+ gem.description = %Q{Rspec html formatter to generate pretty results with images}
22
22
  gem.email = "david.garcia.mora@gmail.com"
23
23
  gem.authors = ["Kingsley Hendrickse", "David Garcia"]
24
24
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/example.rb CHANGED
@@ -16,9 +16,7 @@ class Example
16
16
  @metadata = example.metadata
17
17
  @file_path = @metadata[:file_path]
18
18
  @exception = Oopsy.new(example.exception, @file_path)
19
- filename = File.basename(@metadata[:file_path])
20
- line_number = @metadata[:line_number]
21
- @screenshot = @metadata[:screenshot] || "#{filename}-#{line_number}.png"
19
+ @screenshot = screenshot_path
22
20
  @spec = nil
23
21
  end
24
22
 
@@ -34,9 +32,17 @@ class Example
34
32
  @spec = spec
35
33
  end
36
34
 
37
- def klass(prefix='label-')
38
- class_map = {passed: "#{prefix}success", failed: "#{prefix}danger", pending: "#{prefix}warning"}
35
+ def klass(prefix = 'label-')
36
+ class_map = { passed: "#{prefix}success", failed: "#{prefix}danger", pending: "#{prefix}warning" }
39
37
  class_map[@status.to_sym]
40
38
  end
41
39
 
40
+ private
41
+
42
+ def screenshot_path
43
+ filename = File.basename(@metadata[:file_path])
44
+ line_number = @metadata[:line_number]
45
+ default_path = "#{filename}-#{line_number}.png"
46
+ File.exist?(default_path) ? default_path : @metadata[:screenshot]
47
+ end
42
48
  end
@@ -0,0 +1,19 @@
1
+ * {
2
+ font-size: 14px;
3
+ }
4
+
5
+ .collapsable {
6
+ cursor:pointer;
7
+ }
8
+
9
+ .collapsable:focus {
10
+ outline:none;
11
+ }
12
+
13
+ .collapsable:focus .panel-danger {
14
+ display: block;
15
+ }
16
+
17
+ .panel-danger {
18
+ display:none;
19
+ }
@@ -2,17 +2,17 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: rspec_yah_formatter 0.0.4 ruby lib
5
+ # stub: rspec_yah_formatter 0.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rspec_yah_formatter"
9
- s.version = "0.0.4"
9
+ s.version = "0.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Kingsley Hendrickse", "David Garcia"]
14
- s.date = "2016-02-12"
15
- s.description = "Rspec custom formatter to generate pretty html results"
14
+ s.date = "2016-02-15"
15
+ s.description = "Rspec html formatter to generate pretty results with images"
16
16
  s.email = "david.garcia.mora@gmail.com"
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
39
39
  "resources/bootstrap-3.2.0-dist/js/bootstrap.min.js",
40
40
  "resources/jquery-1.11.1.min.js",
41
41
  "resources/jscharts.js",
42
+ "resources/styles.css",
42
43
  "rspec_yah_formatter.gemspec",
43
44
  "spec/penders_spec.rb",
44
45
  "spec/rspec_html_formatter_spec.rb",
@@ -48,7 +49,7 @@ Gem::Specification.new do |s|
48
49
  s.homepage = "http://github.com/dgmora/rspec_yah_formatter"
49
50
  s.licenses = ["MIT"]
50
51
  s.rubygems_version = "2.5.1"
51
- s.summary = "Rspec custom formatter to generate pretty html results"
52
+ s.summary = "Rspec html formatter to generate pretty results with images"
52
53
 
53
54
  if s.respond_to? :specification_version then
54
55
  s.specification_version = 4
data/templates/report.erb CHANGED
@@ -9,6 +9,7 @@
9
9
  <!-- Bootstrap -->
10
10
  <link href="resources/bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">
11
11
  <link href="resources/bootstrap-3.2.0-dist/css/bootstrap-theme-yeti.min.css" rel="stylesheet">
12
+ <link href="resources/styles.css" rel="stylesheet">
12
13
 
13
14
  <!--[if lt IE 9]>
14
15
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
@@ -18,20 +19,10 @@
18
19
  <script src="resources/jquery-1.11.1.min.js"></script>
19
20
  <script src="resources/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
20
21
  <script src="resources/jscharts.js"></script>
21
- <style>
22
- * {
23
- font-size: 14px;
24
- }
25
-
26
- <%= Rouge::Themes::Github.render(:scope => '.highlight') %>
27
- table tr {
28
- cursor: pointer;
29
- }
30
- </style>
31
22
  </head>
23
+
32
24
  <body>
33
25
  <div class="container">
34
-
35
26
  <div class="bs-docs-section clearfix">
36
27
  <div class="row">
37
28
  <div class="col-lg-12">
@@ -97,7 +88,7 @@
97
88
  </thead>
98
89
  <tbody>
99
90
  <% @examples.each do |example| %>
100
- <tr>
91
+ <tr <%= "class='collapsable' tabindex='1'" if example.has_exception? %> >
101
92
  <td><span class="label <%= example.klass %>"><%= example.status %></span></td>
102
93
  <td>
103
94
  <div>
@@ -115,7 +106,7 @@
115
106
  <% end %>
116
107
  </div>
117
108
  <% if example.has_exception? %>
118
- <div hidden class="panel panel-danger test-error">
109
+ <div class="panel panel-danger">
119
110
  <div class="panel-heading">
120
111
  <h3 class="panel-title"><%= example.exception.klass %></h3>
121
112
  </div>
@@ -124,10 +115,12 @@
124
115
  <h5><%= example.exception.backtrace_message %></h5>
125
116
  <%= example.exception.highlighted_source %>
126
117
  </div>
118
+ <% if example.screenshot %>
119
+ <div class="panel panel-default">
120
+ <img src="<%= example.screenshot %>">
121
+ <div>
122
+ <% end %>
127
123
  </div>
128
- <div hidden class="panel panel-default test-error">
129
- <img src="<%=example.screenshot%>">
130
- <div>
131
124
  <% end %>
132
125
  </td>
133
126
  <td><%= example.duration %></td>
@@ -167,10 +160,6 @@
167
160
  myChart2.setAxisNameY('');
168
161
  myChart2.setAxisValuesNumberX(1);
169
162
  myChart2.draw();
170
-
171
- $('table tr').click(function () {
172
- $(this).find('.test-error').toggle();
173
- });
174
163
  </script>
175
164
 
176
165
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_yah_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kingsley Hendrickse
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-12 00:00:00.000000000 Z
12
+ date: 2016-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-core
@@ -109,7 +109,7 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
- description: Rspec custom formatter to generate pretty html results
112
+ description: Rspec html formatter to generate pretty results with images
113
113
  email: david.garcia.mora@gmail.com
114
114
  executables: []
115
115
  extensions: []
@@ -137,6 +137,7 @@ files:
137
137
  - resources/bootstrap-3.2.0-dist/js/bootstrap.min.js
138
138
  - resources/jquery-1.11.1.min.js
139
139
  - resources/jscharts.js
140
+ - resources/styles.css
140
141
  - rspec_yah_formatter.gemspec
141
142
  - spec/penders_spec.rb
142
143
  - spec/rspec_html_formatter_spec.rb
@@ -165,5 +166,5 @@ rubyforge_project:
165
166
  rubygems_version: 2.5.1
166
167
  signing_key:
167
168
  specification_version: 4
168
- summary: Rspec custom formatter to generate pretty html results
169
+ summary: Rspec html formatter to generate pretty results with images
169
170
  test_files: []