rspec-legacy_formatters 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +1 -0
  4. data/.gitignore +11 -0
  5. data/.rspec +2 -0
  6. data/.travis.yml +16 -0
  7. data/.yardopts +7 -0
  8. data/Changelog.md +3 -0
  9. data/Gemfile +30 -0
  10. data/License.txt +22 -0
  11. data/README.md +41 -0
  12. data/Rakefile +27 -0
  13. data/cucumber.yml +6 -0
  14. data/features/custom_formatter.feature +28 -0
  15. data/features/regression_tests_for_built_in_formatters.feature +86 -0
  16. data/features/regression_tests_for_custom_formatters.feature +94 -0
  17. data/features/step_definitions/additional_cli_steps.rb +4 -0
  18. data/features/support/env.rb +13 -0
  19. data/lib/rspec/legacy_formatters.rb +59 -0
  20. data/lib/rspec/legacy_formatters/adaptor.rb +230 -0
  21. data/lib/rspec/legacy_formatters/base_formatter.rb +248 -0
  22. data/lib/rspec/legacy_formatters/base_text_formatter.rb +330 -0
  23. data/lib/rspec/legacy_formatters/documentation_formatter.rb +69 -0
  24. data/lib/rspec/legacy_formatters/helpers.rb +108 -0
  25. data/lib/rspec/legacy_formatters/html_formatter.rb +157 -0
  26. data/lib/rspec/legacy_formatters/html_printer.rb +412 -0
  27. data/lib/rspec/legacy_formatters/json_formatter.rb +71 -0
  28. data/lib/rspec/legacy_formatters/progress_formatter.rb +31 -0
  29. data/lib/rspec/legacy_formatters/snippet_extractor.rb +92 -0
  30. data/lib/rspec/legacy_formatters/version.rb +9 -0
  31. data/maintenance-branch +1 -0
  32. data/rspec-legacy_formatters.gemspec +43 -0
  33. data/script/functions.sh +144 -0
  34. data/script/run_build +13 -0
  35. data/spec/rspec/legacy_formatters_spec.rb +184 -0
  36. data/spec/spec_helper.rb +7 -0
  37. data/spec/support/formatter_support.rb +83 -0
  38. data/spec/support/legacy_formatter_using_sub_classing_example.rb +87 -0
  39. data/spec/support/old_style_formatter_example.rb +69 -0
  40. metadata +243 -0
  41. metadata.gz.sig +2 -0
@@ -0,0 +1,7 @@
1
+ require 'rspec/support/spec'
2
+ RSpec::Support::Spec.setup_simplecov
3
+
4
+ # This MUST be loaded early, before rspec-core's formatters are loaded.
5
+ require 'rspec/legacy_formatters'
6
+
7
+ Dir['./spec/support/**/*.rb'].map { |f| require f }
@@ -0,0 +1,83 @@
1
+ module FormatterSupport
2
+
3
+ def send_notification type, notification
4
+ reporter.notify type, notification
5
+ end
6
+
7
+ def reporter
8
+ @reporter ||= setup_reporter
9
+ end
10
+
11
+ def setup_reporter(*streams)
12
+ config.add_formatter described_class, *streams
13
+ @formatter = config.formatters.first
14
+ @reporter = config.reporter
15
+ end
16
+
17
+ def output
18
+ @output ||= StringIO.new
19
+ end
20
+
21
+ def config
22
+ @configuration ||=
23
+ begin
24
+ config = RSpec::Core::Configuration.new
25
+ config.output_stream = output
26
+ config
27
+ end
28
+ end
29
+
30
+ def configure
31
+ yield config
32
+ end
33
+
34
+ def formatter
35
+ @formatter ||=
36
+ begin
37
+ setup_reporter
38
+ @formatter
39
+ end
40
+ end
41
+
42
+ def example
43
+ instance_double("RSpec::Core::Example",
44
+ :description => "Example",
45
+ :full_description => "Example",
46
+ :execution_result => { :exception => Exception.new },
47
+ :metadata => {}
48
+ )
49
+ end
50
+
51
+ def group
52
+ class_double "RSpec::Core::ExampleGroup", :description => "Group"
53
+ end
54
+
55
+ def start_notification(count)
56
+ ::RSpec::Core::Notifications::StartNotification.new count
57
+ end
58
+
59
+ def example_notification(specific_example = example)
60
+ ::RSpec::Core::Notifications::ExampleNotification.new specific_example
61
+ end
62
+
63
+ def group_notification
64
+ ::RSpec::Core::Notifications::GroupNotification.new group
65
+ end
66
+
67
+ def message_notification(message)
68
+ ::RSpec::Core::Notifications::MessageNotification.new message
69
+ end
70
+
71
+ def null_notification
72
+ ::RSpec::Core::Notifications::NullNotification
73
+ end
74
+
75
+ def seed_notification(seed, used = true)
76
+ ::RSpec::Core::Notifications::SeedNotification.new seed, used
77
+ end
78
+
79
+ def summary_notification(duration, examples, failed, pending, time)
80
+ ::RSpec::Core::Notifications::SummaryNotification.new duration, examples, failed, pending, time
81
+ end
82
+
83
+ end
@@ -0,0 +1,87 @@
1
+ require 'rspec/core/formatters/base_text_formatter'
2
+
3
+ class LegacyFormatterUsingSubClassing < RSpec::Core::Formatters::BaseTextFormatter
4
+
5
+ def initialize(output)
6
+ super nil
7
+ @output = output
8
+ end
9
+
10
+ def start(example_count)
11
+ super
12
+ @output.puts "Started #{example_count.to_s} examples"
13
+ end
14
+
15
+ def example_group_started(group)
16
+ super
17
+ @output.puts "Started #{group.description}"
18
+ end
19
+
20
+ def example_group_finished(group)
21
+ super
22
+ @output.puts "Finished #{group.description}"
23
+ end
24
+
25
+ def example_started(example)
26
+ super
27
+ @output.puts "Started #{example.full_description}"
28
+ end
29
+
30
+ def stop
31
+ super
32
+ @output.puts "Stopped"
33
+ end
34
+
35
+ def message(message)
36
+ super
37
+ @output.puts message
38
+ end
39
+
40
+ def dump_failures
41
+ super
42
+ @output.puts "Failures:"
43
+ end
44
+
45
+ def dump_summary(duration, example_count, failure_count, pending_count)
46
+ super
47
+ @output.puts "\nFinished in #{duration}\n" +
48
+ "#{failure_count}/#{example_count} failed.\n" +
49
+ "#{pending_count} pending."
50
+ end
51
+
52
+ def dump_pending
53
+ super
54
+ @output.puts "Pending:"
55
+ end
56
+
57
+ def seed(number)
58
+ super
59
+ @output.puts "Randomized with seed #{number}"
60
+ end
61
+
62
+ def close
63
+ super
64
+ @output.close
65
+ end
66
+
67
+ def example_passed(example)
68
+ super
69
+ @output.print '.'
70
+ end
71
+
72
+ def example_pending(example)
73
+ super
74
+ @output.print 'P'
75
+ end
76
+
77
+ def example_failed(example)
78
+ super
79
+ @output.print 'F'
80
+ end
81
+
82
+ def start_dump
83
+ super
84
+ @output.puts "Dumping!"
85
+ end
86
+
87
+ end
@@ -0,0 +1,69 @@
1
+ class OldStyleFormatterExample
2
+
3
+ def initialize(output)
4
+ @output = output
5
+ end
6
+
7
+ def start(example_count)
8
+ @output.puts "Started #{example_count.to_s} examples"
9
+ end
10
+
11
+ def example_group_started(group)
12
+ @output.puts "Started #{group.description}"
13
+ end
14
+
15
+ def example_group_finished(group)
16
+ @output.puts "Finished #{group.description}"
17
+ end
18
+
19
+ def example_started(example)
20
+ @output.puts "Started #{example.full_description}"
21
+ end
22
+
23
+ def stop
24
+ @output.puts "Stopped"
25
+ end
26
+
27
+ def message(message)
28
+ @output.puts message
29
+ end
30
+
31
+ def dump_failures
32
+ @output.puts "Failures:"
33
+ end
34
+
35
+ def dump_summary(duration, example_count, failure_count, pending_count)
36
+ @output.puts "\nFinished in #{duration}\n" +
37
+ "#{failure_count}/#{example_count} failed.\n" +
38
+ "#{pending_count} pending."
39
+ end
40
+
41
+ def dump_pending
42
+ @output.puts "Pending:"
43
+ end
44
+
45
+ def seed(number)
46
+ @output.puts "Randomized with seed #{number}"
47
+ end
48
+
49
+ def close
50
+ @output.close
51
+ end
52
+
53
+ def example_passed(example)
54
+ @output.print '.'
55
+ end
56
+
57
+ def example_pending(example)
58
+ @output.print 'P'
59
+ end
60
+
61
+ def example_failed(example)
62
+ @output.print 'F'
63
+ end
64
+
65
+ def start_dump
66
+ @output.puts "Dumping!"
67
+ end
68
+
69
+ end
metadata ADDED
@@ -0,0 +1,243 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-legacy_formatters
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.rc1
5
+ platform: ruby
6
+ authors:
7
+ - Jon Rowe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRIwEAYDVQQDDAlyc3Bl
14
+ Yy1kZXYxGzAZBgoJkiaJk/IsZAEZFgtnb29nbGVnb3VwczETMBEGCgmSJomT8ixk
15
+ ARkWA2NvbTAeFw0xMzExMDcxOTQ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
+ 1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
32
+ muA=
33
+ -----END CERTIFICATE-----
34
+ date: 2014-05-16 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec-core
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.0.0.beta2
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.0.0.beta2
50
+ - !ruby/object:Gem::Dependency
51
+ name: rspec-support
52
+ requirement: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 3.0.0.beta2
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 3.0.0.beta2
64
+ - !ruby/object:Gem::Dependency
65
+ name: cucumber
66
+ requirement: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '1.3'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.3'
78
+ - !ruby/object:Gem::Dependency
79
+ name: aruba
80
+ requirement: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '0.5'
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '0.5'
92
+ - !ruby/object:Gem::Dependency
93
+ name: rake
94
+ requirement: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
97
+ - !ruby/object:Gem::Version
98
+ version: 10.0.0
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: 10.0.0
106
+ - !ruby/object:Gem::Dependency
107
+ name: fuubar
108
+ requirement: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - '='
111
+ - !ruby/object:Gem::Version
112
+ version: 1.3.2
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - '='
118
+ - !ruby/object:Gem::Version
119
+ version: 1.3.2
120
+ - !ruby/object:Gem::Dependency
121
+ name: nyan-cat-formatter
122
+ requirement: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - '='
125
+ - !ruby/object:Gem::Version
126
+ version: 0.5.2
127
+ type: :development
128
+ prerelease: false
129
+ version_requirements: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - '='
132
+ - !ruby/object:Gem::Version
133
+ version: 0.5.2
134
+ - !ruby/object:Gem::Dependency
135
+ name: rspec-instafail
136
+ requirement: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - '='
139
+ - !ruby/object:Gem::Version
140
+ version: 0.2.4
141
+ type: :development
142
+ prerelease: false
143
+ version_requirements: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - '='
146
+ - !ruby/object:Gem::Version
147
+ version: 0.2.4
148
+ - !ruby/object:Gem::Dependency
149
+ name: rspec-extra-formatters
150
+ requirement: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - '='
153
+ - !ruby/object:Gem::Version
154
+ version: 1.0.0
155
+ type: :development
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - '='
160
+ - !ruby/object:Gem::Version
161
+ version: 1.0.0
162
+ - !ruby/object:Gem::Dependency
163
+ name: fivemat
164
+ requirement: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - '='
167
+ - !ruby/object:Gem::Version
168
+ version: 1.2.1
169
+ type: :development
170
+ prerelease: false
171
+ version_requirements: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - '='
174
+ - !ruby/object:Gem::Version
175
+ version: 1.2.1
176
+ description: Support for RSpec 2.x formatters on 3.x
177
+ email: rspec@googlegroups.com
178
+ executables: []
179
+ extensions: []
180
+ extra_rdoc_files: []
181
+ files:
182
+ - ".gitignore"
183
+ - ".rspec"
184
+ - ".travis.yml"
185
+ - ".yardopts"
186
+ - Changelog.md
187
+ - Gemfile
188
+ - License.txt
189
+ - README.md
190
+ - Rakefile
191
+ - cucumber.yml
192
+ - features/custom_formatter.feature
193
+ - features/regression_tests_for_built_in_formatters.feature
194
+ - features/regression_tests_for_custom_formatters.feature
195
+ - features/step_definitions/additional_cli_steps.rb
196
+ - features/support/env.rb
197
+ - lib/rspec/legacy_formatters.rb
198
+ - lib/rspec/legacy_formatters/adaptor.rb
199
+ - lib/rspec/legacy_formatters/base_formatter.rb
200
+ - lib/rspec/legacy_formatters/base_text_formatter.rb
201
+ - lib/rspec/legacy_formatters/documentation_formatter.rb
202
+ - lib/rspec/legacy_formatters/helpers.rb
203
+ - lib/rspec/legacy_formatters/html_formatter.rb
204
+ - lib/rspec/legacy_formatters/html_printer.rb
205
+ - lib/rspec/legacy_formatters/json_formatter.rb
206
+ - lib/rspec/legacy_formatters/progress_formatter.rb
207
+ - lib/rspec/legacy_formatters/snippet_extractor.rb
208
+ - lib/rspec/legacy_formatters/version.rb
209
+ - maintenance-branch
210
+ - rspec-legacy_formatters.gemspec
211
+ - script/functions.sh
212
+ - script/run_build
213
+ - spec/rspec/legacy_formatters_spec.rb
214
+ - spec/spec_helper.rb
215
+ - spec/support/formatter_support.rb
216
+ - spec/support/legacy_formatter_using_sub_classing_example.rb
217
+ - spec/support/old_style_formatter_example.rb
218
+ homepage: http://github.com/rspec/rspec-legacy_formatters
219
+ licenses:
220
+ - MIT
221
+ metadata: {}
222
+ post_install_message:
223
+ rdoc_options:
224
+ - "--charset=UTF-8"
225
+ require_paths:
226
+ - lib
227
+ required_ruby_version: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - ">="
230
+ - !ruby/object:Gem::Version
231
+ version: 1.8.7
232
+ required_rubygems_version: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">"
235
+ - !ruby/object:Gem::Version
236
+ version: 1.3.1
237
+ requirements: []
238
+ rubyforge_project:
239
+ rubygems_version: 2.2.2
240
+ signing_key:
241
+ specification_version: 4
242
+ summary: rspec-legacy_formatters-1.0.0.rc1
243
+ test_files: []