cucumber 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/.rspec +1 -1
  2. data/Caliper.yml +4 -0
  3. data/History.txt +1557 -0
  4. data/LICENSE +1 -1
  5. data/README.rdoc +26 -0
  6. data/Rakefile +51 -5
  7. data/VERSION.yml +5 -0
  8. data/bin/cucumber +1 -7
  9. data/cucumber.gemspec +77 -3
  10. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  11. data/examples/i18n/he/features/step_definitons/calculator_steps.rb +1 -1
  12. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +7 -4
  13. data/examples/i18n/ro/features/suma.feature +11 -0
  14. data/examples/i18n/ru/features/division.feature +2 -2
  15. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +3 -3
  16. data/examples/sinatra/features/support/env.rb +5 -2
  17. data/examples/v8/features/fibonacci.feature +1 -1
  18. data/examples/watir/features/step_definitions/search_steps.rb +1 -1
  19. data/features/announce.feature +164 -0
  20. data/features/around_hooks.feature +232 -0
  21. data/features/background.feature +95 -284
  22. data/features/bug_371.feature +32 -0
  23. data/features/bug_464.feature +16 -0
  24. data/features/bug_475.feature +42 -0
  25. data/features/bug_585_tab_indentation.feature +22 -0
  26. data/features/bug_600.feature +67 -0
  27. data/features/call_steps_from_stepdefs.feature +154 -0
  28. data/features/cucumber_cli.feature +591 -0
  29. data/features/cucumber_cli_outlines.feature +117 -0
  30. data/features/custom_formatter.feature +73 -3
  31. data/features/default_snippets.feature +42 -0
  32. data/features/diffing.feature +25 -0
  33. data/features/drb_server_integration.feature +174 -0
  34. data/features/exception_in_after_block.feature +127 -0
  35. data/features/exception_in_after_step_block.feature +104 -0
  36. data/features/exception_in_before_block.feature +98 -0
  37. data/features/exclude_files.feature +20 -0
  38. data/features/expand.feature +60 -0
  39. data/features/html_formatter.feature +8 -0
  40. data/features/html_formatter/a.html +582 -0
  41. data/features/json_formatter.feature +245 -160
  42. data/features/junit_formatter.feature +88 -0
  43. data/features/language_from_header.feature +30 -0
  44. data/features/language_help.feature +78 -0
  45. data/features/listener_debugger_formatter.feature +42 -0
  46. data/features/multiline_names.feature +44 -0
  47. data/features/negative_tagged_hooks.feature +60 -0
  48. data/features/post_configuration_hook.feature +37 -0
  49. data/features/profiles.feature +126 -0
  50. data/features/rake_task.feature +152 -0
  51. data/features/report_called_undefined_steps.feature +34 -0
  52. data/features/rerun_formatter.feature +45 -0
  53. data/features/simplest.feature +11 -0
  54. data/features/snippet.feature +23 -0
  55. data/features/snippets_when_using_star_keyword.feature +36 -0
  56. data/features/step_definitions/cucumber_steps.rb +153 -7
  57. data/features/step_definitions/extra_steps.rb +2 -0
  58. data/features/step_definitions/simplest_steps.rb +3 -0
  59. data/features/step_definitions/wire_steps.rb +32 -0
  60. data/features/support/env.rb +140 -18
  61. data/features/support/env.rb.simplest +7 -0
  62. data/features/support/fake_wire_server.rb +77 -0
  63. data/features/table_diffing.feature +45 -0
  64. data/features/table_mapping.feature +34 -0
  65. data/features/tag_logic.feature +258 -0
  66. data/features/transform.feature +245 -0
  67. data/features/unicode_table.feature +35 -0
  68. data/features/usage_and_stepdefs_formatter.feature +169 -0
  69. data/features/wire_protocol.feature +332 -0
  70. data/features/wire_protocol_table_diffing.feature +119 -0
  71. data/features/wire_protocol_tags.feature +87 -0
  72. data/features/wire_protocol_timeouts.feature +63 -0
  73. data/features/work_in_progress.feature +156 -0
  74. data/fixtures/json/features/pystring.feature +8 -0
  75. data/fixtures/junit/features/pending.feature +1 -3
  76. data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
  77. data/fixtures/self_test/features/background/background_with_name.feature +7 -0
  78. data/fixtures/self_test/features/background/failing_background.feature +12 -0
  79. data/fixtures/self_test/features/background/failing_background_after_success.feature +11 -0
  80. data/fixtures/self_test/features/background/multiline_args_background.feature +32 -0
  81. data/fixtures/self_test/features/background/passing_background.feature +10 -0
  82. data/fixtures/self_test/features/background/pending_background.feature +10 -0
  83. data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +16 -0
  84. data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +16 -0
  85. data/fixtures/self_test/features/support/env.rb +0 -8
  86. data/fixtures/tickets/features.html +1 -1
  87. data/gem_tasks/examples.rake +1 -1
  88. data/gem_tasks/features.rake +14 -0
  89. data/gem_tasks/sdoc.rake +12 -0
  90. data/lib/cucumber.rb +0 -12
  91. data/lib/cucumber/ast.rb +1 -1
  92. data/lib/cucumber/ast/background.rb +5 -21
  93. data/lib/cucumber/ast/examples.rb +4 -12
  94. data/lib/cucumber/ast/feature.rb +5 -13
  95. data/lib/cucumber/ast/feature_element.rb +4 -9
  96. data/lib/cucumber/ast/outline_table.rb +4 -4
  97. data/lib/cucumber/ast/py_string.rb +80 -0
  98. data/lib/cucumber/ast/scenario.rb +5 -7
  99. data/lib/cucumber/ast/scenario_outline.rb +15 -23
  100. data/lib/cucumber/ast/step.rb +0 -5
  101. data/lib/cucumber/ast/step_invocation.rb +15 -21
  102. data/lib/cucumber/ast/table.rb +8 -14
  103. data/lib/cucumber/ast/tree_walker.rb +48 -10
  104. data/lib/cucumber/cli/configuration.rb +8 -33
  105. data/lib/cucumber/cli/main.rb +35 -20
  106. data/lib/cucumber/cli/options.rb +7 -8
  107. data/lib/cucumber/cli/profile_loader.rb +0 -2
  108. data/lib/cucumber/core_ext/proc.rb +1 -2
  109. data/lib/cucumber/feature_file.rb +15 -47
  110. data/lib/cucumber/formatter/ansicolor.rb +5 -3
  111. data/lib/cucumber/formatter/color_io.rb +23 -0
  112. data/lib/cucumber/formatter/console.rb +23 -27
  113. data/lib/cucumber/formatter/cucumber.css +17 -34
  114. data/lib/cucumber/formatter/cucumber.sass +182 -173
  115. data/lib/cucumber/formatter/html.rb +11 -46
  116. data/lib/cucumber/formatter/io.rb +4 -2
  117. data/lib/cucumber/formatter/json.rb +152 -15
  118. data/lib/cucumber/formatter/json_pretty.rb +6 -5
  119. data/lib/cucumber/formatter/junit.rb +22 -28
  120. data/lib/cucumber/formatter/pdf.rb +6 -6
  121. data/lib/cucumber/formatter/pretty.rb +5 -5
  122. data/lib/cucumber/formatter/rerun.rb +11 -22
  123. data/lib/cucumber/formatter/tag_cloud.rb +35 -0
  124. data/lib/cucumber/formatter/unicode.rb +20 -41
  125. data/lib/cucumber/js_support/js_dsl.js +4 -4
  126. data/lib/cucumber/js_support/js_language.rb +5 -9
  127. data/lib/cucumber/js_support/js_snippets.rb +2 -2
  128. data/lib/cucumber/language_support.rb +2 -2
  129. data/lib/cucumber/parser/gherkin_builder.rb +30 -35
  130. data/lib/cucumber/platform.rb +8 -8
  131. data/lib/cucumber/py_support/py_language.rb +2 -2
  132. data/lib/cucumber/rake/task.rb +31 -74
  133. data/lib/cucumber/rb_support/rb_dsl.rb +0 -1
  134. data/lib/cucumber/rb_support/rb_language.rb +8 -10
  135. data/lib/cucumber/rb_support/rb_step_definition.rb +0 -8
  136. data/lib/cucumber/rb_support/rb_transform.rb +0 -17
  137. data/lib/cucumber/rb_support/rb_world.rb +18 -26
  138. data/lib/cucumber/rspec/doubles.rb +3 -3
  139. data/lib/cucumber/step_match.rb +2 -6
  140. data/lib/cucumber/step_mother.rb +427 -6
  141. data/lib/cucumber/wire_support/configuration.rb +1 -4
  142. data/lib/cucumber/wire_support/wire_language.rb +10 -3
  143. data/spec/cucumber/ast/background_spec.rb +6 -68
  144. data/spec/cucumber/ast/feature_factory.rb +4 -5
  145. data/spec/cucumber/ast/feature_spec.rb +4 -4
  146. data/spec/cucumber/ast/outline_table_spec.rb +1 -1
  147. data/spec/cucumber/ast/py_string_spec.rb +40 -0
  148. data/spec/cucumber/ast/scenario_outline_spec.rb +11 -15
  149. data/spec/cucumber/ast/scenario_spec.rb +4 -4
  150. data/spec/cucumber/ast/step_spec.rb +3 -3
  151. data/spec/cucumber/ast/table_spec.rb +2 -38
  152. data/spec/cucumber/ast/tree_walker_spec.rb +2 -2
  153. data/spec/cucumber/broadcaster_spec.rb +1 -1
  154. data/spec/cucumber/cli/configuration_spec.rb +6 -32
  155. data/spec/cucumber/cli/drb_client_spec.rb +3 -2
  156. data/spec/cucumber/cli/main_spec.rb +43 -43
  157. data/spec/cucumber/cli/options_spec.rb +1 -28
  158. data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
  159. data/spec/cucumber/core_ext/proc_spec.rb +1 -1
  160. data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
  161. data/spec/cucumber/formatter/color_io_spec.rb +29 -0
  162. data/spec/cucumber/formatter/duration_spec.rb +1 -1
  163. data/spec/cucumber/formatter/html_spec.rb +5 -3
  164. data/spec/cucumber/formatter/junit_spec.rb +2 -16
  165. data/spec/cucumber/formatter/progress_spec.rb +1 -1
  166. data/spec/cucumber/formatter/spec_helper.rb +12 -11
  167. data/spec/cucumber/rb_support/rb_language_spec.rb +28 -241
  168. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +28 -33
  169. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
  170. data/spec/cucumber/step_match_spec.rb +9 -11
  171. data/spec/cucumber/step_mother_spec.rb +302 -0
  172. data/spec/cucumber/wire_support/configuration_spec.rb +1 -1
  173. data/spec/cucumber/wire_support/connection_spec.rb +1 -1
  174. data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
  175. data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
  176. data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
  177. data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
  178. data/spec/cucumber/world/pending_spec.rb +2 -2
  179. data/spec/spec_helper.rb +20 -13
  180. metadata +78 -4
@@ -1,247 +1,256 @@
1
1
  /* cucumber.css is generated from cucumber.sass */
2
2
  /* Regenerate with rake sass */
3
3
 
4
- $step_left: 5px solid
5
- $step_bottom: 1px solid
4
+ !step_left = 5px "solid"
5
+ !step_bottom = 1px "solid"
6
6
 
7
- $failed: #fffbd3
8
- $failed_border: #c20000
9
- $failed_text: #c20000
7
+ !failed = #FFFBD3
8
+ !failed_border = #C20000
9
+ !failed_text = #C20000
10
10
 
11
- $passed: #dbffb4
12
- $passed_border: #65c400
13
- $passed_text: #3d7700
11
+ !passed = #DBFFB4
12
+ !passed_border = #65C400
13
+ !passed_text = #3D7700
14
14
 
15
- $skipped: #e0ffff
16
- $skipped_border: aqua
17
- $skipped_text: #001111
15
+ !skipped = #E0FFFF
16
+ !skipped_border = #00FFFF
17
+ !skipped_text = #001111
18
18
 
19
- $pending: #fcfb98
20
- $pending_border: #faf834
21
- $pending_text: #131313
19
+ !pending = #FCFB98
20
+ !pending_border = #FAF834
21
+ !pending_text = #131313
22
22
 
23
- $undefined: #fcfb98
24
- $undefined_border: #faf834
25
- $undefined_text: #131313
26
-
27
- $message: #e0ffff
28
- $message_border: aqua
29
- $message_text: #001111
23
+ !undefined = #FCFB98
24
+ !undefined_border = #FAF834
25
+ !undefined_text = #131313
30
26
 
31
27
  body
32
- font-size: 0px
33
- color: white
34
- margin: 0px
35
- padding: 0px
28
+ :font-size 0px
29
+ :color #FFFFFF
30
+ :margin 0px
31
+ :padding 0px
36
32
 
37
33
  .cucumber,td,th
38
- font: normal 11px "Lucida Grande", Helvetica, sans-serif
39
- background: white
40
- color: black
34
+ :font normal 11px "Lucida Grande", Helvetica, sans-serif
35
+ :background white
36
+ :color #000000
37
+
41
38
  #cucumber-header
42
- background: #65c400
43
- color: white
44
- height: 6em
39
+ :background #65C400
40
+ :color #FFFFFF
41
+ :height 6em
42
+
45
43
  #expand-collapse
46
44
  p
47
- float: right
48
- margin: 0 0 0 10px
45
+ :float right
46
+ :margin 0 0 0 10px
47
+
49
48
  .scenario
50
49
  h3
51
- font-size: 11px
52
- padding: 3px
53
- margin: 0
54
- background: #65c400
55
- color: white
56
- font-weight: bold
50
+ :font-size 11px
51
+ :padding 3px
52
+ :margin 0
53
+ :background #65C400
54
+ :color #FFFFFF
55
+ :font-weight bold
56
+
57
57
  h1
58
- margin: 0px 10px 0px 10px
59
- padding: 10px
60
- font-family: "Lucida Grande", Helvetica, sans-serif
61
- font-size: 2em
62
- position: absolute
58
+ :margin 0px 10px 0px 10px
59
+ :padding 10px
60
+ :font-family "Lucida Grande", Helvetica, sans-serif
61
+ :font-size 2em
62
+ :position absolute
63
+
63
64
  h4
64
- margin-bottom: 2px
65
+ :margin-bottom 2px
66
+
65
67
  div.feature
66
- padding: 2px
67
- margin: 0px 10px 5px 10px
68
+ :padding 2px
69
+ :margin 0px 10px 5px 10px
70
+
68
71
  div.examples
69
- padding: 0em 0em 0em 1em
72
+ :padding 0em 0em 0em 1em
73
+
70
74
  .stats
71
- margin: 2em
75
+ :margin 2em
76
+
72
77
  .summary
73
78
  ul.features
74
79
  li
75
- display: inline
80
+ :display inline
81
+
76
82
  .step_name
77
- float: left
83
+ :float left
84
+
78
85
  .step_file
79
- text-align: right
80
- color: #999999
86
+ :text-align right
87
+ :color #999999
81
88
  a
82
- color: #999999
83
- .scenario_file
84
- float: right
85
- color: #999999
89
+ :color #999999
90
+
91
+
86
92
  .tag
87
- font-weight: bold
88
- color: #246ac1
93
+ :font-weight bold
94
+ :color #246AC1
95
+
89
96
  .backtrace
90
- margin-top: 0
91
- margin-bottom: 0
92
- margin-left: 1em
93
- color: black
97
+ :margin-top 0
98
+ :margin-bottom 0
99
+ :margin-left 1em
100
+ :color #000000
101
+
94
102
  a
95
- text-decoration: none
96
- color: #be5c00
103
+ :text-decoration none
104
+ :color #BE5C00
105
+
97
106
  &:hover
98
- text-decoration: underline
107
+ :text-decoration underline
99
108
  &:visited
100
- font-weight: normal
109
+ :font-weight normal
110
+
101
111
  div.examples
102
- margin: 5px 0px 5px 15px
103
- color: black
112
+ :margin 5px 0px 5px 15px
113
+ :color #000000
114
+
104
115
  .outline
105
116
  table
106
- margin: 0px 0px 5px 10px
117
+ :margin 0px 0px 5px 10px
118
+
107
119
  table
108
- border-collapse: collapse
120
+ :border-collapse collapse
109
121
  td
110
- padding: 3px 3px 3px 5px
122
+ :padding 3px 3px 3px 5px
111
123
  td.failed, td.passed, td.skipped, td.pending, td.undefined
112
- padding-left: 18px
113
- padding-right: 10px
124
+ :padding-left 18px
125
+ :padding-right 10px
114
126
  td.failed
115
- border-left: $step_left $failed_border
116
- border-bottom: $step_bottom $failed_border
117
- background: $failed
118
- color: $failed_text
127
+ :border-left= !step_left !failed_border
128
+ :border-bottom= !step_bottom !failed_border
129
+ :background= !failed
130
+ :color= !failed_text
119
131
  td.passed
120
- border-left: $step_left $passed_border
121
- border-bottom: $step_bottom $passed_border
122
- background: $passed
123
- color: $passed_text
132
+ :border-left= !step_left !passed_border
133
+ :border-bottom= !step_bottom !passed_border
134
+ :background= !passed
135
+ :color= !passed_text
124
136
  td.skipped
125
- border-left: $step_left $skipped_border
126
- border-bottom: $step_bottom $skipped_border
127
- background: $skipped
128
- color: $skipped_text
137
+ :border-left= !step_left !skipped_border
138
+ :border-bottom= !step_bottom !skipped_border
139
+ :background= !skipped
140
+ :color= !skipped_text
129
141
  td.pending
130
- border-left: $step_left $pending_border
131
- border-bottom: $step_bottom $pending_border
132
- background: $pending
133
- color: $pending_text
142
+ :border-left= !step_left !pending_border
143
+ :border-bottom= !step_bottom !pending_border
144
+ :background= !pending
145
+ :color= !pending_text
134
146
  td.undefined
135
- border-left: $step_left $undefined_border
136
- border-bottom: $step_bottom $undefined_border
137
- background: $undefined
138
- color: $undefined_text
139
- td.message
140
- border-left: $step_left $message_border
141
- border-bottom: $step_bottom $message_border
142
- background: $message
143
- color: $message_text
147
+ :border-left= !step_left !undefined_border
148
+ :border-bottom= !step_bottom !undefined_border
149
+ :background= !undefined
150
+ :color= !undefined_text
151
+
144
152
  ol
145
- list-style: none
146
- margin: 0px
147
- padding: 0px
153
+ :list-style none
154
+ :margin 0px
155
+ :padding 0px
156
+
148
157
  li.step
149
- padding: 3px 3px 3px 18px
150
- margin: 5px 0px 5px 5px
158
+ :padding 3px 3px 3px 18px
159
+ :margin 5px 0px 5px 5px
151
160
  li
152
- margin: 0em 0em 0em 1em
153
- padding: 0em 0em 0em 0.2em
161
+ :margin 0em 0em 0em 1em
162
+ :padding 0em 0em 0em 0.2em
154
163
  span.param
155
- font-weight: bold
164
+ :font-weight bold
156
165
  li.failed
157
- border-left: $step_left $failed_border
158
- border-bottom: $step_bottom $failed_border
159
- background: $failed
160
- color: $failed_text
166
+ :border-left= !step_left !failed_border
167
+ :border-bottom= !step_bottom !failed_border
168
+ :background= !failed
169
+ :color= !failed_text
161
170
  li.passed
162
- border-left: $step_left $passed_border
163
- border-bottom: $step_bottom $passed_border
164
- background: $passed
165
- color: $passed_text
171
+ :border-left= !step_left !passed_border
172
+ :border-bottom= !step_bottom !passed_border
173
+ :background= !passed
174
+ :color= !passed_text
166
175
  li.skipped
167
- border-left: $step_left $skipped_border
168
- border-bottom: $step_bottom $skipped_border
169
- background: $skipped
170
- color: $skipped_text
176
+ :border-left= !step_left !skipped_border
177
+ :border-bottom= !step_bottom !skipped_border
178
+ :background= !skipped
179
+ :color= !skipped_text
171
180
  li.pending
172
- border-left: $step_left $pending_border
173
- border-bottom: $step_bottom $pending_border
174
- background: $pending
175
- color: $pending_text
181
+ :border-left= !step_left !pending_border
182
+ :border-bottom= !step_bottom !pending_border
183
+ :background= !pending
184
+ :color= !pending_text
176
185
  li.undefined
177
- border-left: $step_left $undefined_border
178
- border-bottom: $step_bottom $undefined_border
179
- background: $undefined
180
- color: $undefined_text
181
- li.message
182
- border-left: $step_left $message_border
183
- border-bottom: $step_bottom $message_border
184
- background: $message
185
- color: $message_text
186
- margin-left: 10px
186
+ :border-left= !step_left !undefined_border
187
+ :border-bottom= !step_bottom !undefined_border
188
+ :background= !undefined
189
+ :color= !undefined_text
190
+
187
191
  #summary
188
- margin: 0px
189
- padding: 5px 10px
190
- text-align: right
191
- top: 0px
192
- right: 0px
193
- float: right
192
+ :margin 0px
193
+ :padding 5px 10px
194
+ :text-align right
195
+ :top 0px
196
+ :right 0px
197
+ :float right
198
+
194
199
  p
195
- margin: 0 0 0 2px
196
- #totals
197
- font-size: 1.2em
200
+ :margin 0 0 0 2px
198
201
 
202
+ #totals
203
+ :font-size 1.2em
204
+
199
205
  .ruby
200
- font-size: 12px
201
- font-family: monospace
202
- color: white
203
- background: black
204
- padding: 0.1em 0 0.2em 0
205
- .keyword
206
- color: #ff6600
206
+ :font-size 12px
207
+ :font-family monospace
208
+ :color white
209
+ :background black
210
+ :padding 0.1em 0 0.2em 0
211
+
212
+ .keyword
213
+ :color #FF6600
207
214
  .constant
208
- color: #339999
215
+ :color #339999
209
216
  .attribute
210
- color: white
217
+ :color white
211
218
  .global
212
- color: white
219
+ :color white
213
220
  .module
214
- color: white
221
+ :color white
215
222
  .class
216
- color: white
223
+ :color white
217
224
  .string
218
- color: #66ff00
225
+ :color #66FF00
219
226
  .ident
220
- color: white
227
+ :color white
221
228
  .method
222
- color: #ffcc00
229
+ :color #FFCC00
223
230
  .number
224
- color: white
231
+ :color white
225
232
  .char
226
- color: white
233
+ :color white
227
234
  .comment
228
- color: #9933cc
235
+ :color #9933CC
229
236
  .symbol
230
- color: white
237
+ :color white
231
238
  .regex
232
- color: #44b4cc
239
+ :color #44B4CC
233
240
  .punct
234
- color: white
241
+ :color white
235
242
  .escape
236
- color: white
237
- .interp
238
- color: white
239
- .expr
240
- color: white
243
+ :color white
244
+ .interp
245
+ :color white
246
+ .expr
247
+ :color white
248
+
241
249
  .offending
242
- background: #333333
250
+ :background #333333
243
251
  .linenum
244
- width: 75px
245
- padding: 0.1em 1em 0.2em 0
246
- color: black
247
- background: #fffbd3
252
+ :width 75px
253
+ :padding 0.1em 1em 0.2em 0
254
+ :color #000000
255
+ :background #FFFBD3
256
+
@@ -20,23 +20,20 @@ module Cucumber
20
20
  @scenario_number = 0
21
21
  @step_number = 0
22
22
  @header_red = nil
23
- @delayed_messages = []
24
- @img_id = 0
25
23
  end
26
24
 
27
- def embed(src, mime_type, label)
25
+ def embed(file, mime_type)
28
26
  case(mime_type)
29
27
  when /^image\/(png|gif|jpg|jpeg)/
30
- embed_image(src, label)
28
+ embed_image(file)
31
29
  end
32
30
  end
33
31
 
34
- def embed_image(src, label)
35
- id = "img_#{@img_id}"
36
- @img_id += 1
32
+ def embed_image(file)
33
+ id = file.hash
37
34
  @builder.span(:class => 'embed') do |pre|
38
- pre << %{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = (img.style.display == 'none' ? 'block' : 'none');return false">#{label}</a><br>&nbsp;
39
- <img id="#{id}" style="display: none" src="#{src}"/>}
35
+ pre << %{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = (img.style.display == 'none' ? 'block' : 'none');return false">Screenshot</a><br>&nbsp;
36
+ <img id="#{id}" style="display: none" src="#{file}"/>}
40
37
  end
41
38
  end
42
39
 
@@ -166,9 +163,6 @@ module Cucumber
166
163
  end
167
164
 
168
165
  def scenario_name(keyword, name, file_colon_line, source_indent)
169
- @builder.span(:class => 'scenario_file') do
170
- @builder << file_colon_line
171
- end
172
166
  @listing_background = false
173
167
  @builder.h3(:id => "scenario_#{@scenario_number}") do
174
168
  @builder.span(keyword + ':', :class => 'keyword')
@@ -251,7 +245,6 @@ module Cucumber
251
245
  end
252
246
  end
253
247
  @builder << '</li>'
254
- print_messages
255
248
  end
256
249
 
257
250
  def step_name(keyword, step_match, status, source_indent, background)
@@ -288,7 +281,7 @@ module Cucumber
288
281
  end
289
282
  end
290
283
 
291
- def doc_string(string)
284
+ def py_string(string)
292
285
  return if @hide_this_step
293
286
  @builder.pre(:class => 'val') do |pre|
294
287
  @builder << string.gsub("\n", '&#x000A;')
@@ -305,7 +298,6 @@ module Cucumber
305
298
 
306
299
  def after_table_row(table_row)
307
300
  return if @hide_this_step
308
- print_table_row_messages
309
301
  @builder << '</tr>'
310
302
  if table_row.exception
311
303
  @builder.tr do
@@ -335,35 +327,8 @@ module Cucumber
335
327
  @col_index += 1
336
328
  end
337
329
 
338
- def puts(message)
339
- @delayed_messages << message
340
- #@builder.pre(message, :class => 'message')
341
- end
342
-
343
- def print_messages
344
- return if @delayed_messages.empty?
345
-
346
- #@builder.ol do
347
- @delayed_messages.each do |ann|
348
- @builder.li(:class => 'step message') do
349
- @builder << ann
350
- end
351
- end
352
- #end
353
- empty_messages
354
- end
355
-
356
- def print_table_row_messages
357
- return if @delayed_messages.empty?
358
-
359
- @builder.td(:class => 'message') do
360
- @builder << @delayed_messages.join(", ")
361
- end
362
- empty_messages
363
- end
364
-
365
- def empty_messages
366
- @delayed_messages = []
330
+ def announce(announcement)
331
+ @builder.pre(announcement, :class => 'announcement')
367
332
  end
368
333
 
369
334
  protected
@@ -393,7 +358,7 @@ module Cucumber
393
358
  end
394
359
 
395
360
  def set_scenario_color(status)
396
- if status == :undefined or status == :pending
361
+ if status == :undefined
397
362
  set_scenario_color_pending
398
363
  end
399
364
  if status == :failed
@@ -558,7 +523,7 @@ module Cucumber
558
523
  end
559
524
 
560
525
  def backtrace_line(line)
561
- line.gsub(/\A([^:]*\.(?:rb|feature|haml)):(\d*).*\z/) do
526
+ line.gsub(/^([^:]*\.(?:rb|feature|haml)):(\d*)/) do
562
527
  if ENV['TM_PROJECT_DIRECTORY']
563
528
  "<a href=\"txmt://open?url=file://#{File.expand_path($1)}&line=#{$2}\">#{$1}:#{$2}</a> "
564
529
  else