pretty_face 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,24 +0,0 @@
1
- begin
2
- require 'builder'
3
- rescue LoadError
4
- gem 'builder'
5
- require 'builder'
6
- end
7
-
8
- module Cucumber
9
- module Formatter
10
- # Emits attributes ordered alphabetically, so that we can predicatbly test output.
11
- class OrderedXmlMarkup < Builder::XmlMarkup #:nodoc:
12
- def _insert_attributes(attrs, order=[])
13
- return if attrs.nil?
14
- keys = attrs.keys.map{|k| k.to_s}
15
- keys.sort!
16
- keys.reverse! if (attrs.keys - [:version, :encoding] == []) #HACK to ensure the 'version' attribute is first in xml declaration.
17
- keys.each do |k|
18
- v = attrs[k.to_sym] || attrs[k]
19
- @target << %{ #{k}="#{_attr_value(v)}"} if v
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,35 +0,0 @@
1
- module Cucumber
2
- module Formatter
3
- module Summary
4
-
5
- def scenario_summary(step_mother, &block)
6
- scenarios_proc = lambda{|status| step_mother.scenarios(status)}
7
- dump_count(step_mother.scenarios.length, "scenario") + dump_status_counts(scenarios_proc, &block)
8
- end
9
-
10
- def step_summary(step_mother, &block)
11
- steps_proc = lambda{|status| step_mother.steps(status)}
12
- dump_count(step_mother.steps.length, "step") + dump_status_counts(steps_proc, &block)
13
- end
14
-
15
- private
16
-
17
- def dump_status_counts(find_elements_proc)
18
- counts = [:failed, :skipped, :undefined, :pending, :passed].map do |status|
19
- elements = find_elements_proc.call(status)
20
- elements.any? ? yield("#{elements.length} #{status.to_s}", status) : nil
21
- end.compact
22
- if counts.any?
23
- " (#{counts.join(', ')})"
24
- else
25
- ""
26
- end
27
- end
28
-
29
- def dump_count(count, what, state=nil)
30
- [count, state, "#{what}#{count == 1 ? '' : 's'}"].compact.join(" ")
31
- end
32
-
33
- end
34
- end
35
- end
Binary file