rspec-core 3.0.0.beta1 → 3.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data.tar.gz.sig +0 -0
  2. data/Changelog.md +137 -0
  3. data/README.md +2 -2
  4. data/exe/rspec +2 -23
  5. data/features/README.md +1 -5
  6. data/features/command_line/README.md +7 -10
  7. data/features/command_line/exit_status.feature +1 -1
  8. data/features/command_line/format_option.feature +1 -1
  9. data/features/command_line/init.feature +40 -1
  10. data/features/command_line/line_number_option.feature +2 -2
  11. data/features/command_line/ruby.feature +5 -4
  12. data/features/configuration/enable_global_dsl.feature +54 -0
  13. data/features/example_groups/aliasing.feature +48 -0
  14. data/features/example_groups/basic_structure.feature +1 -1
  15. data/features/expectation_framework_integration/configure_expectation_framework.feature +1 -1
  16. data/features/filtering/if_and_unless.feature +0 -30
  17. data/features/formatters/custom_formatter.feature +32 -0
  18. data/features/formatters/regression_tests.feature +95 -0
  19. data/features/hooks/around_hooks.feature +1 -0
  20. data/features/hooks/before_and_after_hooks.feature +2 -2
  21. data/features/mock_framework_integration/use_flexmock.feature +11 -13
  22. data/features/mock_framework_integration/use_mocha.feature +11 -13
  23. data/features/mock_framework_integration/use_rr.feature +11 -13
  24. data/features/mock_framework_integration/use_rspec.feature +11 -13
  25. data/features/pending_and_skipped_examples/README.md +3 -0
  26. data/features/pending_and_skipped_examples/pending_examples.feature +118 -0
  27. data/features/pending_and_skipped_examples/skipped_examples.feature +106 -0
  28. data/features/step_definitions/additional_cli_steps.rb +34 -0
  29. data/features/subject/explicit_subject.feature +1 -1
  30. data/features/subject/one_liner_syntax.feature +71 -0
  31. data/lib/rspec/core.rb +6 -14
  32. data/lib/rspec/core/backtrace_formatter.rb +16 -4
  33. data/lib/rspec/core/command_line.rb +2 -3
  34. data/lib/rspec/core/configuration.rb +114 -125
  35. data/lib/rspec/core/configuration_options.rb +32 -18
  36. data/lib/rspec/core/dsl.rb +80 -18
  37. data/lib/rspec/core/example.rb +84 -33
  38. data/lib/rspec/core/example_group.rb +95 -43
  39. data/lib/rspec/core/filter_manager.rb +31 -40
  40. data/lib/rspec/core/formatters.rb +137 -0
  41. data/lib/rspec/core/formatters/base_formatter.rb +28 -41
  42. data/lib/rspec/core/formatters/base_text_formatter.rb +26 -37
  43. data/lib/rspec/core/formatters/deprecation_formatter.rb +48 -27
  44. data/lib/rspec/core/formatters/documentation_formatter.rb +27 -22
  45. data/lib/rspec/core/formatters/html_formatter.rb +48 -56
  46. data/lib/rspec/core/formatters/html_printer.rb +11 -18
  47. data/lib/rspec/core/formatters/json_formatter.rb +18 -22
  48. data/lib/rspec/core/formatters/legacy_formatter.rb +227 -0
  49. data/lib/rspec/core/formatters/progress_formatter.rb +7 -10
  50. data/lib/rspec/core/hooks.rb +250 -217
  51. data/lib/rspec/core/memoized_helpers.rb +43 -9
  52. data/lib/rspec/core/mocking_adapters/flexmock.rb +29 -0
  53. data/lib/rspec/core/{mocking/with_mocha.rb → mocking_adapters/mocha.rb} +19 -16
  54. data/lib/rspec/core/mocking_adapters/null.rb +12 -0
  55. data/lib/rspec/core/mocking_adapters/rr.rb +28 -0
  56. data/lib/rspec/core/mocking_adapters/rspec.rb +30 -0
  57. data/lib/rspec/core/notifications.rb +100 -0
  58. data/lib/rspec/core/option_parser.rb +11 -18
  59. data/lib/rspec/core/pending.rb +78 -47
  60. data/lib/rspec/core/project_initializer.rb +2 -49
  61. data/lib/rspec/core/project_initializer/dot_rspec +3 -0
  62. data/lib/rspec/core/project_initializer/spec_helper.rb +82 -0
  63. data/lib/rspec/core/rake_task.rb +5 -14
  64. data/lib/rspec/core/reporter.rb +24 -32
  65. data/lib/rspec/core/ruby_project.rb +1 -1
  66. data/lib/rspec/core/runner.rb +14 -4
  67. data/lib/rspec/core/shared_example_group.rb +40 -13
  68. data/lib/rspec/core/version.rb +1 -1
  69. data/spec/command_line/order_spec.rb +15 -15
  70. data/spec/rspec/core/backtrace_formatter_spec.rb +15 -1
  71. data/spec/rspec/core/command_line_spec.rb +18 -17
  72. data/spec/rspec/core/configuration_options_spec.rb +57 -34
  73. data/spec/rspec/core/configuration_spec.rb +162 -184
  74. data/spec/rspec/core/drb_command_line_spec.rb +5 -7
  75. data/spec/rspec/core/drb_options_spec.rb +2 -2
  76. data/spec/rspec/core/dsl_spec.rb +79 -15
  77. data/spec/rspec/core/example_group_spec.rb +253 -39
  78. data/spec/rspec/core/example_spec.rb +149 -33
  79. data/spec/rspec/core/filter_manager_spec.rb +9 -26
  80. data/spec/rspec/core/formatters/base_formatter_spec.rb +2 -5
  81. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +42 -145
  82. data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +64 -34
  83. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +15 -28
  84. data/spec/rspec/core/formatters/helpers_spec.rb +2 -2
  85. data/spec/rspec/core/formatters/{html_formatted-1.8.7.html → html_formatted-2.1.0.html} +22 -44
  86. data/spec/rspec/core/formatters/{html_formatted-1.8.7-jruby.html → html_formatted.html} +30 -49
  87. data/spec/rspec/core/formatters/html_formatter_spec.rb +35 -19
  88. data/spec/rspec/core/formatters/json_formatter_spec.rb +42 -40
  89. data/spec/rspec/core/formatters/legacy_formatter_spec.rb +137 -0
  90. data/spec/rspec/core/formatters/progress_formatter_spec.rb +38 -25
  91. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +1 -1
  92. data/spec/rspec/core/formatters_spec.rb +120 -0
  93. data/spec/rspec/core/hooks_filtering_spec.rb +1 -1
  94. data/spec/rspec/core/hooks_spec.rb +13 -2
  95. data/spec/rspec/core/memoized_helpers_spec.rb +17 -8
  96. data/spec/rspec/core/metadata_spec.rb +3 -3
  97. data/spec/rspec/core/option_parser_spec.rb +53 -46
  98. data/spec/rspec/core/ordering_spec.rb +4 -4
  99. data/spec/rspec/core/pending_example_spec.rb +23 -126
  100. data/spec/rspec/core/pending_spec.rb +8 -0
  101. data/spec/rspec/core/project_initializer_spec.rb +8 -41
  102. data/spec/rspec/core/rake_task_spec.rb +15 -4
  103. data/spec/rspec/core/random_spec.rb +1 -1
  104. data/spec/rspec/core/reporter_spec.rb +50 -37
  105. data/spec/rspec/core/resources/formatter_specs.rb +9 -11
  106. data/spec/rspec/core/rspec_matchers_spec.rb +1 -1
  107. data/spec/rspec/core/ruby_project_spec.rb +3 -3
  108. data/spec/rspec/core/runner_spec.rb +65 -23
  109. data/spec/rspec/core/shared_context_spec.rb +4 -4
  110. data/spec/rspec/core/shared_example_group/collection_spec.rb +1 -1
  111. data/spec/rspec/core/shared_example_group_spec.rb +20 -11
  112. data/spec/rspec/core/warnings_spec.rb +1 -1
  113. data/spec/rspec/core/world_spec.rb +10 -10
  114. data/spec/rspec/core_spec.rb +2 -2
  115. data/spec/spec_helper.rb +12 -24
  116. data/spec/support/config_options_helper.rb +1 -3
  117. data/spec/support/formatter_support.rb +83 -0
  118. data/spec/support/isolate_load_path_mutation.rb +1 -2
  119. data/spec/support/isolated_directory.rb +1 -1
  120. data/spec/support/isolated_home_directory.rb +1 -1
  121. data/spec/support/legacy_formatter_using_sub_classing_example.rb +87 -0
  122. data/spec/support/matchers.rb +20 -0
  123. data/spec/support/mathn_integration_support.rb +2 -2
  124. data/spec/support/old_style_formatter_example.rb +69 -0
  125. data/spec/support/shared_example_groups.rb +1 -1
  126. data/spec/support/spec_files.rb +3 -3
  127. metadata +192 -69
  128. metadata.gz.sig +3 -1
  129. checksums.yaml +0 -15
  130. checksums.yaml.gz.sig +0 -2
  131. data/features/configuration/show_failures_in_pending_blocks.feature +0 -61
  132. data/features/pending/pending_examples.feature +0 -229
  133. data/features/subject/implicit_receiver.feature +0 -29
  134. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +0 -11
  135. data/lib/rspec/core/mocking/with_flexmock.rb +0 -27
  136. data/lib/rspec/core/mocking/with_rr.rb +0 -27
  137. data/lib/rspec/core/mocking/with_rspec.rb +0 -27
  138. data/spec/rspec/core/formatters/html_formatted-1.8.7-rbx.html +0 -477
  139. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +0 -425
  140. data/spec/rspec/core/formatters/html_formatted-1.9.3-jruby.html +0 -416
  141. data/spec/rspec/core/formatters/html_formatted-1.9.3-rbx.html +0 -477
  142. data/spec/rspec/core/formatters/html_formatted-1.9.3.html +0 -419
  143. data/spec/rspec/core/formatters/html_formatted-2.0.0.html +0 -425
  144. data/spec/support/in_sub_process.rb +0 -37
  145. data/spec/support/sandboxed_mock_space.rb +0 -100
@@ -5,6 +5,8 @@ module RSpec
5
5
  module Core
6
6
  module Formatters
7
7
  class DeprecationFormatter
8
+ Formatters.register self, :deprecation, :deprecation_summary
9
+
8
10
  attr_reader :count, :deprecation_stream, :summary_stream
9
11
 
10
12
  def initialize(deprecation_stream, summary_stream)
@@ -13,30 +15,33 @@ module RSpec
13
15
  @seen_deprecations = Set.new
14
16
  @count = 0
15
17
  end
18
+ alias :output :deprecation_stream
16
19
 
17
20
  def printer
18
21
  @printer ||= case deprecation_stream
19
- when File, RaiseErrorStream
22
+ when File
23
+ ImmediatePrinter.new(FileStream.new(deprecation_stream), summary_stream, self)
24
+ when RaiseErrorStream
20
25
  ImmediatePrinter.new(deprecation_stream, summary_stream, self)
21
26
  else
22
27
  DelayedPrinter.new(deprecation_stream, summary_stream, self)
23
28
  end
24
29
  end
25
30
 
26
- def deprecation(data)
27
- return if @seen_deprecations.include?(data)
31
+ def deprecation(notification)
32
+ return if @seen_deprecations.include? notification
28
33
 
29
34
  @count += 1
30
- printer.print_deprecation_message data
31
- @seen_deprecations << data
35
+ printer.print_deprecation_message notification
36
+ @seen_deprecations << notification
32
37
  end
33
38
 
34
- def deprecation_summary
39
+ def deprecation_summary(notification)
35
40
  printer.deprecation_summary
36
41
  end
37
42
 
38
43
  def deprecation_message_for(data)
39
- if data[:message]
44
+ if data.message
40
45
  SpecifiedDeprecationMessage.new(data)
41
46
  else
42
47
  GeneratedDeprecationMessage.new(data)
@@ -53,7 +58,7 @@ module RSpec
53
58
 
54
59
  SpecifiedDeprecationMessage = Struct.new(:type) do
55
60
  def initialize(data)
56
- @message = data[:message]
61
+ @message = data.message
57
62
  super deprecation_type_for(data)
58
63
  end
59
64
 
@@ -70,20 +75,20 @@ module RSpec
70
75
  private
71
76
 
72
77
  def deprecation_type_for(data)
73
- data[:message].gsub(/(\w+\/)+\w+\.rb:\d+/, '')
78
+ data.message.gsub(/(\w+\/)+\w+\.rb:\d+/, '')
74
79
  end
75
80
  end
76
81
 
77
82
  GeneratedDeprecationMessage = Struct.new(:type) do
78
83
  def initialize(data)
79
84
  @data = data
80
- super data[:deprecated]
85
+ super data.deprecated
81
86
  end
82
87
 
83
88
  def to_s
84
- msg = "#{@data[:deprecated]} is deprecated."
85
- msg << " Use #{@data[:replacement]} instead." if @data[:replacement]
86
- msg << " Called from #{@data[:call_site]}." if @data[:call_site]
89
+ msg = "#{@data.deprecated} is deprecated."
90
+ msg << " Use #{@data.replacement} instead." if @data.replacement
91
+ msg << " Called from #{@data.call_site}." if @data.call_site
87
92
  msg
88
93
  end
89
94
 
@@ -95,19 +100,11 @@ module RSpec
95
100
  end
96
101
 
97
102
  class ImmediatePrinter
98
- include ::RSpec::Core::Formatters::Helpers
99
-
100
103
  attr_reader :deprecation_stream, :summary_stream, :deprecation_formatter
101
104
 
102
105
  def initialize(deprecation_stream, summary_stream, deprecation_formatter)
103
106
  @deprecation_stream = deprecation_stream
104
107
 
105
- # In one of my test suites, I got lots of duplicate output in the
106
- # deprecation file (e.g. 200 of the same deprecation, even though
107
- # the `puts` below was only called 6 times). Setting `sync = true`
108
- # fixes this (but we really have no idea why!).
109
- @deprecation_stream.sync = true
110
-
111
108
  @summary_stream = summary_stream
112
109
  @deprecation_formatter = deprecation_formatter
113
110
  end
@@ -118,10 +115,8 @@ module RSpec
118
115
  end
119
116
 
120
117
  def deprecation_summary
121
- if deprecation_formatter.count > 0
122
- summary_stream.puts "\n#{pluralize(deprecation_formatter.count, 'deprecation')} logged to #{deprecation_stream.path}"
123
- deprecation_stream.puts RAISE_ERROR_CONFIG_NOTICE
124
- end
118
+ return if deprecation_formatter.count.zero?
119
+ deprecation_stream.summarize(summary_stream, deprecation_formatter.count)
125
120
  end
126
121
  end
127
122
 
@@ -176,12 +171,38 @@ module RSpec
176
171
 
177
172
  # Not really a stream, but is usable in place of one.
178
173
  class RaiseErrorStream
174
+ include ::RSpec::Core::Formatters::Helpers
175
+
179
176
  def puts(message)
180
177
  raise DeprecationError, message
181
178
  end
182
179
 
183
- def sync=(value)
184
- # no-op
180
+ def summarize(summary_stream, deprecation_count)
181
+ summary_stream.puts "\n#{pluralize(deprecation_count, 'deprecation')} found."
182
+ end
183
+ end
184
+
185
+ # Wraps a File object and provides file-specific operations.
186
+ class FileStream
187
+ include ::RSpec::Core::Formatters::Helpers
188
+
189
+ def initialize(file)
190
+ @file = file
191
+
192
+ # In one of my test suites, I got lots of duplicate output in the
193
+ # deprecation file (e.g. 200 of the same deprecation, even though
194
+ # the `puts` below was only called 6 times). Setting `sync = true`
195
+ # fixes this (but we really have no idea why!).
196
+ @file.sync = true
197
+ end
198
+
199
+ def puts(*args)
200
+ @file.puts(*args)
201
+ end
202
+
203
+ def summarize(summary_stream, deprecation_count)
204
+ summary_stream.puts "\n#{pluralize(deprecation_count, 'deprecation')} logged to #{@file.path}"
205
+ puts RAISE_ERROR_CONFIG_NOTICE
185
206
  end
186
207
  end
187
208
 
@@ -4,47 +4,42 @@ module RSpec
4
4
  module Core
5
5
  module Formatters
6
6
  class DocumentationFormatter < BaseTextFormatter
7
+ Formatters.register self, :example_group_started, :example_group_finished,
8
+ :example_passed, :example_pending, :example_failed
9
+
7
10
  def initialize(output)
8
- super(output)
11
+ super
9
12
  @group_level = 0
10
13
  end
11
14
 
12
- def example_group_started(example_group)
13
- super(example_group)
15
+ def example_group_started(notification)
16
+ super
14
17
 
15
18
  output.puts if @group_level == 0
16
- output.puts "#{current_indentation}#{example_group.description.strip}"
19
+ output.puts "#{current_indentation}#{notification.group.description.strip}"
17
20
 
18
21
  @group_level += 1
19
22
  end
20
23
 
21
- def example_group_finished(example_group)
24
+ def example_group_finished(notification)
22
25
  @group_level -= 1
23
26
  end
24
27
 
25
- def example_passed(example)
26
- super(example)
27
- output.puts passed_output(example)
28
- end
29
-
30
- def example_pending(example)
31
- super(example)
32
- output.puts pending_output(example, example.execution_result[:pending_message])
28
+ def example_passed(passed)
29
+ output.puts passed_output(passed.example)
33
30
  end
34
31
 
35
- def example_failed(example)
36
- super(example)
37
- output.puts failure_output(example, example.execution_result[:exception])
32
+ def example_pending(pending)
33
+ super
34
+ output.puts pending_output(pending.example, pending.example.execution_result[:pending_message])
38
35
  end
39
36
 
40
- def failure_output(example, exception)
41
- failure_color("#{current_indentation}#{example.description.strip} (FAILED - #{next_failure_index})")
37
+ def example_failed(failure)
38
+ super
39
+ output.puts failure_output(failure.example, failure.example.execution_result[:exception])
42
40
  end
43
41
 
44
- def next_failure_index
45
- @next_failure_index ||= 0
46
- @next_failure_index += 1
47
- end
42
+ private
48
43
 
49
44
  def passed_output(example)
50
45
  success_color("#{current_indentation}#{example.description.strip}")
@@ -54,6 +49,15 @@ module RSpec
54
49
  pending_color("#{current_indentation}#{example.description.strip} (PENDING: #{message})")
55
50
  end
56
51
 
52
+ def failure_output(example, exception)
53
+ failure_color("#{current_indentation}#{example.description.strip} (FAILED - #{next_failure_index})")
54
+ end
55
+
56
+ def next_failure_index
57
+ @next_failure_index ||= 0
58
+ @next_failure_index += 1
59
+ end
60
+
57
61
  def current_indentation
58
62
  ' ' * @group_level
59
63
  end
@@ -61,6 +65,7 @@ module RSpec
61
65
  def example_group_chain
62
66
  example_group.parent_groups.reverse
63
67
  end
68
+
64
69
  end
65
70
  end
66
71
  end
@@ -4,7 +4,10 @@ require 'rspec/core/formatters/html_printer'
4
4
  module RSpec
5
5
  module Core
6
6
  module Formatters
7
- class HtmlFormatter < BaseTextFormatter
7
+ class HtmlFormatter < BaseFormatter
8
+ Formatters.register self, :start, :example_group_started, :start_dump,
9
+ :example_started, :example_passed, :example_failed,
10
+ :example_pending, :dump_summary
8
11
 
9
12
  def initialize(output)
10
13
  super(output)
@@ -14,61 +17,41 @@ module RSpec
14
17
  @printer = HtmlPrinter.new(output)
15
18
  end
16
19
 
17
- private
18
- def method_missing(m, *a, &b)
19
- # no-op
20
- end
21
-
22
- public
23
- def message(message)
24
- end
25
-
26
- # The number of the currently running example_group
27
- def example_group_number
28
- @example_group_number
29
- end
30
-
31
- # The number of the currently running example (a global counter)
32
- def example_number
33
- @example_number
34
- end
35
-
36
- def start(example_count)
37
- super(example_count)
20
+ def start(notification)
21
+ super
38
22
  @printer.print_html_start
39
23
  @printer.flush
40
24
  end
41
25
 
42
- def example_group_started(example_group)
43
- super(example_group)
26
+ def example_group_started(notification)
27
+ super
44
28
  @example_group_red = false
45
29
  @example_group_number += 1
46
30
 
47
31
  unless example_group_number == 1
48
32
  @printer.print_example_group_end
49
33
  end
50
- @printer.print_example_group_start( example_group_number, example_group.description, example_group.parent_groups.size )
34
+ @printer.print_example_group_start( example_group_number, notification.group.description, notification.group.parent_groups.size )
51
35
  @printer.flush
52
36
  end
53
37
 
54
- def start_dump
38
+ def start_dump(notification)
55
39
  @printer.print_example_group_end
56
40
  @printer.flush
57
41
  end
58
42
 
59
- def example_started(example)
60
- super(example)
43
+ def example_started(notification)
61
44
  @example_number += 1
62
45
  end
63
46
 
64
- def example_passed(example)
47
+ def example_passed(passed)
65
48
  @printer.move_progress(percent_done)
66
- @printer.print_example_passed( example.description, example.execution_result[:run_time] )
49
+ @printer.print_example_passed( passed.example.description, passed.example.execution_result[:run_time] )
67
50
  @printer.flush
68
51
  end
69
52
 
70
- def example_failed(example)
71
- super(example)
53
+ def example_failed(failed)
54
+ super
72
55
 
73
56
  unless @header_red
74
57
  @header_red = true
@@ -82,6 +65,8 @@ module RSpec
82
65
 
83
66
  @printer.move_progress(percent_done)
84
67
 
68
+ example = failed.example
69
+
85
70
  exception = example.metadata[:execution_result][:exception]
86
71
  exception_details = if exception
87
72
  {
@@ -105,7 +90,8 @@ module RSpec
105
90
  @printer.flush
106
91
  end
107
92
 
108
- def example_pending(example)
93
+ def example_pending(pending)
94
+ example = pending.example
109
95
 
110
96
  @printer.make_header_yellow unless @header_red
111
97
  @printer.make_example_group_header_yellow(example_group_number) unless @example_group_red
@@ -114,15 +100,26 @@ module RSpec
114
100
  @printer.flush
115
101
  end
116
102
 
117
- # Override this method if you wish to output extra HTML for a failed spec. For example, you
118
- # could output links to images or other files produced during the specs.
119
- #
120
- def extra_failure_content(exception)
121
- require 'rspec/core/formatters/snippet_extractor'
122
- backtrace = exception.backtrace.map {|line| configuration.backtrace_formatter.backtrace_line(line)}
123
- backtrace.compact!
124
- @snippet_extractor ||= SnippetExtractor.new
125
- " <pre class=\"ruby\"><code>#{@snippet_extractor.snippet(backtrace)}</code></pre>"
103
+ def dump_summary(summary)
104
+ @printer.print_summary(
105
+ summary.duration,
106
+ summary.example_count,
107
+ summary.failure_count,
108
+ summary.pending_count
109
+ )
110
+ @printer.flush
111
+ end
112
+
113
+ private
114
+
115
+ # The number of the currently running example_group
116
+ def example_group_number
117
+ @example_group_number
118
+ end
119
+
120
+ # The number of the currently running example (a global counter)
121
+ def example_number
122
+ @example_number
126
123
  end
127
124
 
128
125
  def percent_done
@@ -133,22 +130,17 @@ module RSpec
133
130
  result
134
131
  end
135
132
 
136
- def dump_failures
137
- end
138
-
139
- def dump_pending
133
+ # Override this method if you wish to output extra HTML for a failed spec. For example, you
134
+ # could output links to images or other files produced during the specs.
135
+ #
136
+ def extra_failure_content(exception)
137
+ require 'rspec/core/formatters/snippet_extractor'
138
+ backtrace = exception.backtrace.map {|line| configuration.backtrace_formatter.backtrace_line(line)}
139
+ backtrace.compact!
140
+ @snippet_extractor ||= SnippetExtractor.new
141
+ " <pre class=\"ruby\"><code>#{@snippet_extractor.snippet(backtrace)}</code></pre>"
140
142
  end
141
143
 
142
- def dump_summary(duration, example_count, failure_count, pending_count)
143
- @printer.print_summary(
144
- dry_run?,
145
- duration,
146
- example_count,
147
- failure_count,
148
- pending_count
149
- )
150
- @printer.flush
151
- end
152
144
  end
153
145
  end
154
146
  end
@@ -19,18 +19,18 @@ module RSpec
19
19
  @output.puts "</div>"
20
20
  end
21
21
 
22
- def print_example_group_start( group_id, description, number_of_parents )
22
+ def print_example_group_start(group_id, description, number_of_parents)
23
23
  @output.puts "<div id=\"div_group_#{group_id}\" class=\"example_group passed\">"
24
24
  @output.puts " <dl #{indentation_style(number_of_parents)}>"
25
25
  @output.puts " <dt id=\"example_group_#{group_id}\" class=\"passed\">#{h(description)}</dt>"
26
26
  end
27
27
 
28
- def print_example_passed( description, run_time )
28
+ def print_example_passed(description, run_time)
29
29
  formatted_run_time = sprintf("%.5f", run_time)
30
30
  @output.puts " <dd class=\"example passed\"><span class=\"passed_spec_name\">#{h(description)}</span><span class='duration'>#{formatted_run_time}s</span></dd>"
31
31
  end
32
32
 
33
- def print_example_failed( pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false )
33
+ def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
34
34
  formatted_run_time = sprintf("%.5f", run_time)
35
35
 
36
36
  @output.puts " <dd class=\"example #{pending_fixed ? 'pending_fixed' : 'failed'}\">"
@@ -50,19 +50,14 @@ module RSpec
50
50
  @output.puts " </dd>"
51
51
  end
52
52
 
53
- def print_example_pending( description, pending_message )
53
+ def print_example_pending(description, pending_message)
54
54
  @output.puts " <dd class=\"example not_implemented\"><span class=\"not_implemented_spec_name\">#{h(description)} (PENDING: #{h(pending_message)})</span></dd>"
55
55
  end
56
56
 
57
- def print_summary( was_dry_run, duration, example_count, failure_count, pending_count )
58
- # TODO - kill dry_run?
59
- if was_dry_run
60
- totals = "This was a dry-run"
61
- else
62
- totals = "#{example_count} example#{'s' unless example_count == 1}, "
63
- totals << "#{failure_count} failure#{'s' unless failure_count == 1}"
64
- totals << ", #{pending_count} pending" if pending_count > 0
65
- end
57
+ def print_summary(duration, example_count, failure_count, pending_count)
58
+ totals = "#{example_count} example#{'s' unless example_count == 1}, "
59
+ totals << "#{failure_count} failure#{'s' unless failure_count == 1}"
60
+ totals << ", #{pending_count} pending" if pending_count > 0
66
61
 
67
62
  formatted_duration = sprintf("%.5f", duration)
68
63
 
@@ -78,7 +73,7 @@ module RSpec
78
73
  @output.flush
79
74
  end
80
75
 
81
- def move_progress( percent_done )
76
+ def move_progress(percent_done)
82
77
  @output.puts " <script type=\"text/javascript\">moveProgressBar('#{percent_done}');</script>"
83
78
  @output.flush
84
79
  end
@@ -101,14 +96,12 @@ module RSpec
101
96
  @output.puts " <script type=\"text/javascript\">makeYellow('example_group_#{group_id}');</script>"
102
97
  end
103
98
 
99
+ private
104
100
 
105
- private
106
-
107
- def indentation_style( number_of_parents )
101
+ def indentation_style(number_of_parents)
108
102
  "style=\"margin-left: #{(number_of_parents - 1) * 15}px;\""
109
103
  end
110
104
 
111
-
112
105
  REPORT_HEADER = <<-EOF
113
106
  <div class="rspec-report">
114
107