pretty_face 0.1 → 0.2

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.
@@ -0,0 +1,149 @@
1
+ /* Colors:
2
+
3
+ light-gray: #F9F9F9;
4
+ mid-gray: #F2F2F2;
5
+ dark-gray: #E0E0E0;
6
+ extra-dark-gray: #AEAEAE;
7
+ aqua: #4B7CAB;
8
+
9
+ */
10
+
11
+ body {
12
+ font-family: GeosansLightRegular,Arial,Helvetica,sans-serif;
13
+ font-size: 1em;
14
+ }
15
+ a, a:visited {
16
+ color: #4B7CAB;
17
+ }
18
+ div {
19
+ padding: 5px;
20
+ }
21
+ h2 {
22
+ margin: 0;
23
+ }
24
+ .summary_body {
25
+ width: 99%;
26
+ margin-top: 15px;
27
+ float: left;
28
+ -moz-border-radius: 15px;
29
+ border-radius: 15px;
30
+ background-color: #E0E0E0;
31
+ }
32
+ .summary_row_header {
33
+ text-align: left;
34
+ font-size: 1em;
35
+ font-weight: bold;
36
+ }
37
+ .summary td {
38
+ font-size: 1em;
39
+ text-align: center;
40
+ width: 150px;
41
+ }
42
+ .summary td:first-child {
43
+ font-size: inherit;
44
+ text-align: inherit;
45
+ width: inherit;
46
+ }
47
+ .failed td {
48
+ font-size: 1em;
49
+ }
50
+ .footer {
51
+ width: 100%;
52
+ background-color: #4B7CAB;
53
+ float: left;
54
+ margin-left: -7px;
55
+ margin-top: 25px;
56
+ font-family: Verdana;
57
+ font-size: 1em;
58
+ color: white
59
+ }
60
+ .failures {
61
+ width: 100%;
62
+ float: left;
63
+ }
64
+ .failures h2 {
65
+ color: #A00000;
66
+ margin-top: 15px;
67
+ margin-left: 5px;
68
+ }
69
+ .scenarios h2 {
70
+ color: #4B7CAB;
71
+ margin-top: 15px;
72
+ margin-left: 5px;
73
+ }
74
+ .results h2 {
75
+ color: #282828;
76
+ margin-top: 12px;
77
+ margin-bottom: 15px;
78
+ }
79
+ .summary h2 {
80
+ color: white;
81
+ margin-left: 5px;
82
+ margin-top: 5px;
83
+ }
84
+ .feature_title {
85
+ background-color: #F0F0F0;
86
+ font-size: 1em;
87
+ }
88
+
89
+ .description {
90
+ border: 1px dotted #CCCCCC;
91
+ border-radius: 8px 8px 8px 8px;
92
+ box-shadow: 1px 1px 5px #DDDDDD;
93
+ line-height: 2em;
94
+ padding: 10px;
95
+ width: 100%;
96
+ font-family: inherit
97
+ }
98
+
99
+
100
+ .failures tr:nth-child(odd) {
101
+ background-color:#F9F9F9;
102
+ }
103
+ .failures tr:nth-child(even) {
104
+ background-color:#F2F2F2;
105
+ }
106
+
107
+ .failures tr td {
108
+ border-top:1px solid #AEAEAE;
109
+ }
110
+ .failures tr:last-child td:first-child {
111
+ border-radius: 0px 0px 0px 18px;
112
+ }
113
+ .failures tr:last-child td:last-child {
114
+ border-radius: 0px 0px 18px 0px;
115
+ }
116
+ .param_table th,.param_table td {
117
+ border: 3px solid #E0E0E0;
118
+ padding-left: 10px;
119
+ padding-right: 10px;
120
+ }
121
+ .multiline_arg {
122
+ padding-left: 15px;
123
+ padding-right: 15px;
124
+ background-color:#F2F2F2;
125
+ }
126
+
127
+ .feature-overview th {
128
+ background-color: #E0E0E0;
129
+ text-align: left;
130
+ }
131
+
132
+ .error {
133
+ color: #b94a48;
134
+ background-color: #f2dede;
135
+ border-color: #eed3d7;
136
+ }
137
+
138
+ .message td {
139
+ padding: 10px;
140
+ font-weight: bold;
141
+ border-radius: 18px 18px 0px 0px;
142
+ }
143
+
144
+ .detail td {
145
+ margin-left: 10px;
146
+ padding: 10px;
147
+ border-radius: 0px 0px 18px 18px;
148
+ }
149
+
@@ -1,3 +1,3 @@
1
1
  module PrettyFace
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
data/pretty_face.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.name = "pretty_face"
7
7
  s.version = PrettyFace::VERSION
8
8
  s.authors = ["Jeffrey S. Morgan", "Joel Byler"]
9
- s.email = ["jeff.morgan@leandog.com", "joelbyler@gmail.com"]
9
+ s.email = ["jeff.morgan@leandog.com", "joelbyler@gmail.com", "steve.jackson@leandogsoftware.com"]
10
10
  s.homepage = "http://github.com/cheezy/pretty_face"
11
11
  s.summary = %q{HTML Report/Formatter for Cucumber and RSpec}
12
12
  s.description = %q{HTML Report/Formatter for cucumber that allows user to modify erb in order to customize.}
@@ -18,6 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
+ s.add_dependency "actionpack", ">= 3.2.11"
22
+
21
23
  s.add_development_dependency "cucumber"
22
24
  s.add_development_dependency "rspec"
23
25
  s.add_development_dependency "aruba"
@@ -9,13 +9,16 @@ describe PrettyFace::Formatter::Html do
9
9
 
10
10
  context "when building the header for the main page" do
11
11
  it "should know the start time" do
12
+ formatter.stub(:make_output_directories)
12
13
  formatter.before_features(nil)
13
14
  formatter.start_time.should eq Time.now.strftime("%a %B %-d, %Y at %H:%M:%S")
14
15
  end
15
-
16
+
16
17
  it "should know how long it takes" do
17
18
  formatter.should_receive(:generate_report)
18
19
  formatter.should_receive(:copy_images_directory)
20
+ formatter.should_receive(:copy_stylesheets_directory)
21
+ formatter.stub(:make_output_directories)
19
22
  formatter.before_features(nil)
20
23
 
21
24
  formatter.after_features(nil)
@@ -29,18 +32,6 @@ describe PrettyFace::Formatter::Html do
29
32
  formatter.scenario_count.should eq 3
30
33
  end
31
34
 
32
- it "should track average scenario durations" do
33
- feature = stub('feature')
34
- parameter.stub(:status).and_return(:passed)
35
- formatter.before_feature(feature)
36
- formatter.before_feature_element(nil)
37
- formatter.after_feature_element(parameter)
38
- formatter.before_feature_element(nil)
39
- formatter.after_feature_element(parameter)
40
-
41
- formatter.scenario_average_duration.should include '0.0'
42
- end
43
-
44
35
  it "should keep track of passing scenarios" do
45
36
  step_mother.should_receive(:scenarios).with(:passed).and_return([1,2])
46
37
  step_mother.should_receive(:scenarios).and_return([1,2])
@@ -77,7 +68,7 @@ describe PrettyFace::Formatter::Html do
77
68
  step_mother.should_receive(:steps).and_return([1,2])
78
69
  formatter.step_count.should == 2
79
70
  end
80
-
71
+
81
72
  it "should keep track of passing steps" do
82
73
  step_mother.should_receive(:steps).with(:passed).and_return([1,2])
83
74
  step_mother.should_receive(:steps).and_return([1,2])
@@ -96,7 +87,7 @@ describe PrettyFace::Formatter::Html do
96
87
  formatter.steps_summary_for(:skipped).should == "2 (100.0%)"
97
88
  end
98
89
 
99
- it "should keep track of pending steps" do
90
+ it "should keep track of pending steps" do
100
91
  step_mother.should_receive(:steps).with(:pending).and_return([1,2])
101
92
  step_mother.should_receive(:steps).and_return([1,2])
102
93
  formatter.steps_summary_for(:pending).should == "2 (100.0%)"
@@ -107,5 +98,43 @@ describe PrettyFace::Formatter::Html do
107
98
  step_mother.should_receive(:steps).and_return([1,2])
108
99
  formatter.steps_summary_for(:undefined).should == "2 (100.0%)"
109
100
  end
110
- end
101
+ end
102
+
103
+ context "when embedding an image" do
104
+ before(:each) do
105
+ cuke_feature = double('cuke_feature')
106
+ cuke_feature.should_receive(:description)
107
+ report_feature = ReportFeature.new(cuke_feature, 'foo')
108
+ formatter.report.features << report_feature
109
+ @scenario = ReportScenario.new(nil)
110
+ formatter.report.current_feature.scenarios << @scenario
111
+ File.stub(:dirname).and_return('')
112
+ FileUtils.stub(:cp)
113
+ end
114
+
115
+ it "should generate an id" do
116
+ formatter.embed('image.png', 'image/png', 'the label')
117
+ @scenario.image_id.should == 'img_0'
118
+ end
119
+
120
+ it "should get the filename from the src" do
121
+ formatter.embed('directory/image.png', 'image/png', 'the label')
122
+ @scenario.image.should == 'image.png'
123
+ end
124
+
125
+ it "should get the image label" do
126
+ formatter.embed('directory/image.png', 'image/png', 'the label')
127
+ @scenario.image_label.should == 'the label'
128
+ end
129
+
130
+ it "scenario should know if it has an image" do
131
+ formatter.embed('directory/image.png', 'image/png', 'the label')
132
+ @scenario.should have_image
133
+ end
134
+
135
+ it "should copy the image to the output directory" do
136
+ FileUtils.should_receive(:cp).with('directory/image.png', '/images')
137
+ formatter.embed('directory/image.png', 'image/png', 'the label')
138
+ end
139
+ end
111
140
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_face
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,8 +10,24 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-17 00:00:00.000000000 Z
13
+ date: 2013-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: actionpack
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 3.2.11
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 3.2.11
15
31
  - !ruby/object:Gem::Dependency
16
32
  name: cucumber
17
33
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +97,7 @@ description: HTML Report/Formatter for cucumber that allows user to modify erb i
81
97
  email:
82
98
  - jeff.morgan@leandog.com
83
99
  - joelbyler@gmail.com
100
+ - steve.jackson@leandogsoftware.com
84
101
  executables: []
85
102
  extensions: []
86
103
  extra_rdoc_files: []
@@ -93,12 +110,17 @@ files:
93
110
  - Guardfile
94
111
  - README.md
95
112
  - Rakefile
113
+ - autotrader.png
96
114
  - cucumber.yml
115
+ - features/feature_pages.feature
97
116
  - features/pretty_face_report.feature
98
117
  - features/support/env.rb
99
118
  - features/support/hooks.rb
100
119
  - fixtures/advanced.feature
120
+ - fixtures/background.feature
101
121
  - fixtures/basic.feature
122
+ - fixtures/failing_background.feature
123
+ - fixtures/more/more.feature
102
124
  - fixtures/step_definitions/advanced_steps.rb
103
125
  - fixtures/step_definitions/basic_steps.rb
104
126
  - fixtures/support/env.rb
@@ -106,13 +128,21 @@ files:
106
128
  - lib/pretty_face/formatter/html.rb
107
129
  - lib/pretty_face/formatter/report.rb
108
130
  - lib/pretty_face/formatter/view_helper.rb
131
+ - lib/pretty_face/templates/_step.erb
109
132
  - lib/pretty_face/templates/face.jpg
110
133
  - lib/pretty_face/templates/failed.jpg
134
+ - lib/pretty_face/templates/failed.png
135
+ - lib/pretty_face/templates/feature.erb
111
136
  - lib/pretty_face/templates/main.erb
112
137
  - lib/pretty_face/templates/passed.jpg
138
+ - lib/pretty_face/templates/passed.png
113
139
  - lib/pretty_face/templates/pending.jpg
140
+ - lib/pretty_face/templates/pending.png
114
141
  - lib/pretty_face/templates/skipped.jpg
142
+ - lib/pretty_face/templates/skipped.png
143
+ - lib/pretty_face/templates/style.css
115
144
  - lib/pretty_face/templates/undefined.jpg
145
+ - lib/pretty_face/templates/undefined.png
116
146
  - lib/pretty_face/version.rb
117
147
  - pretty_face.gemspec
118
148
  - sample_report/LisaCrispin1.png
@@ -144,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
174
  version: '0'
145
175
  segments:
146
176
  - 0
147
- hash: -2027867954849647701
177
+ hash: -4205723903375013439
148
178
  required_rubygems_version: !ruby/object:Gem::Requirement
149
179
  none: false
150
180
  requirements:
@@ -153,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
183
  version: '0'
154
184
  segments:
155
185
  - 0
156
- hash: -2027867954849647701
186
+ hash: -4205723903375013439
157
187
  requirements: []
158
188
  rubyforge_project: pretty_face
159
189
  rubygems_version: 1.8.24
@@ -161,6 +191,7 @@ signing_key:
161
191
  specification_version: 3
162
192
  summary: HTML Report/Formatter for Cucumber and RSpec
163
193
  test_files:
194
+ - features/feature_pages.feature
164
195
  - features/pretty_face_report.feature
165
196
  - features/support/env.rb
166
197
  - features/support/hooks.rb