rspec-core 2.7.1 → 2.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.md +1 -1
  2. data/features/command_line/order.feature +29 -0
  3. data/features/command_line/tag.feature +10 -9
  4. data/features/configuration/default_path.feature +2 -2
  5. data/features/filtering/exclusion_filters.feature +1 -1
  6. data/features/filtering/run_all_when_everything_filtered.feature +1 -1
  7. data/features/subject/attribute_of_subject.feature +1 -1
  8. data/lib/rspec/core.rb +148 -12
  9. data/lib/rspec/core/command_line.rb +2 -2
  10. data/lib/rspec/core/configuration.rb +300 -155
  11. data/lib/rspec/core/configuration_options.rb +34 -53
  12. data/lib/rspec/core/deprecation.rb +4 -0
  13. data/lib/rspec/core/drb_options.rb +72 -0
  14. data/lib/rspec/core/example.rb +58 -24
  15. data/lib/rspec/core/example_group.rb +10 -5
  16. data/lib/rspec/core/extensions.rb +1 -0
  17. data/lib/rspec/core/extensions/ordered.rb +16 -0
  18. data/lib/rspec/core/filter_manager.rb +170 -0
  19. data/lib/rspec/core/formatters/base_formatter.rb +3 -1
  20. data/lib/rspec/core/formatters/base_text_formatter.rb +6 -0
  21. data/lib/rspec/core/formatters/snippet_extractor.rb +1 -1
  22. data/lib/rspec/core/hooks.rb +197 -1
  23. data/lib/rspec/core/let.rb +3 -2
  24. data/lib/rspec/core/metadata.rb +25 -4
  25. data/lib/rspec/core/option_parser.rb +89 -54
  26. data/lib/rspec/core/pending.rb +41 -0
  27. data/lib/rspec/core/rake_task.rb +9 -25
  28. data/lib/rspec/core/reporter.rb +43 -19
  29. data/lib/rspec/core/shared_context.rb +35 -0
  30. data/lib/rspec/core/shared_example_group.rb +0 -1
  31. data/lib/rspec/core/subject.rb +4 -4
  32. data/lib/rspec/core/version.rb +1 -1
  33. data/lib/rspec/core/world.rb +34 -52
  34. data/spec/autotest/failed_results_re_spec.rb +2 -2
  35. data/spec/command_line/order_spec.rb +131 -0
  36. data/spec/rspec/core/command_line_spec.rb +2 -1
  37. data/spec/rspec/core/configuration_options_spec.rb +83 -163
  38. data/spec/rspec/core/configuration_spec.rb +311 -139
  39. data/spec/rspec/core/drb_options_spec.rb +131 -0
  40. data/spec/rspec/core/example_group_spec.rb +22 -11
  41. data/spec/rspec/core/example_spec.rb +1 -2
  42. data/spec/rspec/core/filter_manager_spec.rb +175 -0
  43. data/spec/rspec/core/formatters/helpers_spec.rb +1 -1
  44. data/spec/rspec/core/formatters/html_formatter_spec.rb +3 -2
  45. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +1 -1
  46. data/spec/rspec/core/metadata_spec.rb +21 -6
  47. data/spec/rspec/core/option_parser_spec.rb +74 -0
  48. data/spec/rspec/core/reporter_spec.rb +18 -1
  49. data/spec/rspec/core/shared_context_spec.rb +54 -17
  50. data/spec/rspec/core/subject_spec.rb +1 -1
  51. data/spec/rspec/core/world_spec.rb +7 -188
  52. data/spec/spec_helper.rb +47 -43
  53. data/spec/support/config_options_helper.rb +27 -0
  54. metadata +28 -12
  55. data/lib/rspec/core/expecting/with_rspec.rb +0 -9
  56. data/lib/rspec/core/expecting/with_stdlib.rb +0 -9
@@ -17,6 +17,7 @@ end
17
17
  Spork.prefork do
18
18
  require 'rspec/autorun'
19
19
  require 'autotest/rspec2'
20
+ require 'aruba/api'
20
21
 
21
22
  Dir['./spec/support/**/*.rb'].map {|f| require f}
22
23
 
@@ -28,28 +29,27 @@ Spork.prefork do
28
29
  end
29
30
 
30
31
  def sandboxed(&block)
31
- begin
32
- @orig_config = RSpec.configuration
33
- @orig_world = RSpec.world
34
- new_config = RSpec::Core::Configuration.new
35
- new_world = RSpec::Core::World.new(new_config)
36
- RSpec.instance_variable_set(:@configuration, new_config)
37
- RSpec.instance_variable_set(:@world, new_world)
38
- object = Object.new
39
- object.extend(RSpec::Core::SharedExampleGroup)
32
+ @orig_config = RSpec.configuration
33
+ @orig_world = RSpec.world
34
+ new_config = RSpec::Core::Configuration.new
35
+ new_world = RSpec::Core::World.new(new_config)
36
+ RSpec.instance_variable_set(:@configuration, new_config)
37
+ RSpec.instance_variable_set(:@world, new_world)
38
+ object = Object.new
39
+ object.extend(RSpec::Core::SharedExampleGroup)
40
40
 
41
- (class << RSpec::Core::ExampleGroup; self; end).class_eval do
42
- alias_method :orig_run, :run
43
- def run(reporter=nil)
44
- @orig_mock_space = RSpec::Mocks::space
45
- RSpec::Mocks::space = RSpec::Mocks::Space.new
46
- orig_run(reporter || NullObject.new)
47
- ensure
48
- RSpec::Mocks::space = @orig_mock_space
49
- end
41
+ (class << RSpec::Core::ExampleGroup; self; end).class_eval do
42
+ alias_method :orig_run, :run
43
+ def run(reporter=nil)
44
+ @orig_mock_space = RSpec::Mocks::space
45
+ RSpec::Mocks::space = RSpec::Mocks::Space.new
46
+ orig_run(reporter || NullObject.new)
47
+ ensure
48
+ RSpec::Mocks::space = @orig_mock_space
50
49
  end
50
+ end
51
51
 
52
- object.instance_eval(&block)
52
+ object.instance_eval(&block)
53
53
  ensure
54
54
  (class << RSpec::Core::ExampleGroup; self; end).class_eval do
55
55
  remove_method :run
@@ -59,34 +59,38 @@ Spork.prefork do
59
59
 
60
60
  RSpec.instance_variable_set(:@configuration, @orig_config)
61
61
  RSpec.instance_variable_set(:@world, @orig_world)
62
- end
63
- end
62
+ end
64
63
 
65
- def in_editor?
66
- ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
67
- end
64
+ def in_editor?
65
+ ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
66
+ end
68
67
 
69
- RSpec.configure do |c|
70
- c.color_enabled = !in_editor?
71
- c.filter_run :focus => true
72
- c.run_all_when_everything_filtered = true
73
- c.filter_run_excluding :ruby => lambda {|version|
74
- case version.to_s
75
- when "!jruby"
76
- RUBY_ENGINE == "jruby"
77
- when /^> (.*)/
78
- !(RUBY_VERSION.to_s > $1)
79
- else
80
- !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
81
- end
82
- }
83
- c.alias_it_should_behave_like_to 'it_has_behavior'
84
- c.around do |example|
85
- sandboxed { example.run }
68
+ RSpec.configure do |c|
69
+ # structural
70
+ c.alias_it_should_behave_like_to 'it_has_behavior'
71
+ c.around {|example| sandboxed { example.run }}
72
+ c.include Aruba::Api, :example_group => {
73
+ :file_path => /spec\/command_line/
74
+ }
75
+
76
+ # runtime options
77
+ c.treat_symbols_as_metadata_keys_with_true_values = true
78
+ c.color = !in_editor?
79
+ c.filter_run :focus
80
+ c.filter_run :foo
81
+ c.run_all_when_everything_filtered = true
82
+ c.filter_run_excluding :ruby => lambda {|version|
83
+ case version.to_s
84
+ when "!jruby"
85
+ RUBY_ENGINE == "jruby"
86
+ when /^> (.*)/
87
+ !(RUBY_VERSION.to_s > $1)
88
+ else
89
+ !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
90
+ end
91
+ }
86
92
  end
87
93
  end
88
- end
89
94
 
90
95
  Spork.each_run do
91
96
  end
92
-
@@ -0,0 +1,27 @@
1
+ require 'fakefs/safe'
2
+
3
+ module ConfigOptionsHelper
4
+ extend RSpec::SharedContext
5
+
6
+ before do
7
+ FakeFS.activate!
8
+ @orig_spec_opts = ENV["SPEC_OPTS"]
9
+ ENV.delete("SPEC_OPTS")
10
+ end
11
+
12
+ after do
13
+ FakeFS::FileSystem.clear
14
+ ENV["SPEC_OPTS"] = @orig_spec_opts
15
+ FakeFS.deactivate!
16
+ end
17
+
18
+ def config_options_object(*args)
19
+ coo = RSpec::Core::ConfigurationOptions.new(args)
20
+ coo.parse_options
21
+ coo
22
+ end
23
+
24
+ def parse_options(*args)
25
+ config_options_object(*args).options
26
+ end
27
+ end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease:
4
+ hash: 15424215
5
+ prerelease: 6
6
6
  segments:
7
7
  - 2
8
- - 7
8
+ - 8
9
+ - 0
10
+ - rc
9
11
  - 1
10
- version: 2.7.1
12
+ version: 2.8.0.rc1
11
13
  platform: ruby
12
14
  authors:
13
15
  - Chad Humphries
@@ -16,7 +18,7 @@ autorequire:
16
18
  bindir: exe
17
19
  cert_chain: []
18
20
 
19
- date: 2011-10-20 00:00:00 Z
21
+ date: 2011-11-06 00:00:00 Z
20
22
  dependencies: []
21
23
 
22
24
  description: BDD for Ruby. RSpec runner and example groups.
@@ -40,16 +42,17 @@ files:
40
42
  - lib/rspec/core/configuration_options.rb
41
43
  - lib/rspec/core/deprecation.rb
42
44
  - lib/rspec/core/drb_command_line.rb
45
+ - lib/rspec/core/drb_options.rb
43
46
  - lib/rspec/core/dsl.rb
44
47
  - lib/rspec/core/errors.rb
45
48
  - lib/rspec/core/example.rb
46
49
  - lib/rspec/core/example_group.rb
47
- - lib/rspec/core/expecting/with_rspec.rb
48
- - lib/rspec/core/expecting/with_stdlib.rb
49
50
  - lib/rspec/core/extensions.rb
50
51
  - lib/rspec/core/extensions/instance_eval_with_args.rb
51
52
  - lib/rspec/core/extensions/kernel.rb
52
53
  - lib/rspec/core/extensions/module_eval_with_args.rb
54
+ - lib/rspec/core/extensions/ordered.rb
55
+ - lib/rspec/core/filter_manager.rb
53
56
  - lib/rspec/core/formatters/base_formatter.rb
54
57
  - lib/rspec/core/formatters/base_text_formatter.rb
55
58
  - lib/rspec/core/formatters/documentation_formatter.rb
@@ -92,6 +95,7 @@ files:
92
95
  - features/command_line/format_option.feature
93
96
  - features/command_line/line_number_appended_to_path.feature
94
97
  - features/command_line/line_number_option.feature
98
+ - features/command_line/order.feature
95
99
  - features/command_line/pattern_option.feature
96
100
  - features/command_line/rake_task.feature
97
101
  - features/command_line/ruby.feature
@@ -136,6 +140,7 @@ files:
136
140
  - spec/autotest/discover_spec.rb
137
141
  - spec/autotest/failed_results_re_spec.rb
138
142
  - spec/autotest/rspec_spec.rb
143
+ - spec/command_line/order_spec.rb
139
144
  - spec/rspec/core/command_line_configuration_spec.rb
140
145
  - spec/rspec/core/command_line_spec.rb
141
146
  - spec/rspec/core/command_line_spec_output.txt
@@ -143,8 +148,10 @@ files:
143
148
  - spec/rspec/core/configuration_spec.rb
144
149
  - spec/rspec/core/deprecations_spec.rb
145
150
  - spec/rspec/core/drb_command_line_spec.rb
151
+ - spec/rspec/core/drb_options_spec.rb
146
152
  - spec/rspec/core/example_group_spec.rb
147
153
  - spec/rspec/core/example_spec.rb
154
+ - spec/rspec/core/filter_manager_spec.rb
148
155
  - spec/rspec/core/formatters/base_formatter_spec.rb
149
156
  - spec/rspec/core/formatters/base_text_formatter_spec.rb
150
157
  - spec/rspec/core/formatters/documentation_formatter_spec.rb
@@ -185,6 +192,7 @@ files:
185
192
  - spec/rspec/core/world_spec.rb
186
193
  - spec/rspec/core_spec.rb
187
194
  - spec/spec_helper.rb
195
+ - spec/support/config_options_helper.rb
188
196
  - spec/support/matchers.rb
189
197
  - spec/support/shared_example_groups.rb
190
198
  - spec/support/spec_files.rb
@@ -210,19 +218,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
218
  required_rubygems_version: !ruby/object:Gem::Requirement
211
219
  none: false
212
220
  requirements:
213
- - - ">="
221
+ - - ">"
214
222
  - !ruby/object:Gem::Version
215
- hash: 3
223
+ hash: 25
216
224
  segments:
217
- - 0
218
- version: "0"
225
+ - 1
226
+ - 3
227
+ - 1
228
+ version: 1.3.1
219
229
  requirements: []
220
230
 
221
231
  rubyforge_project: rspec
222
232
  rubygems_version: 1.8.11
223
233
  signing_key:
224
234
  specification_version: 3
225
- summary: rspec-core-2.7.1
235
+ summary: rspec-core-2.8.0.rc1
226
236
  test_files:
227
237
  - features/Autotest.md
228
238
  - features/README.md
@@ -234,6 +244,7 @@ test_files:
234
244
  - features/command_line/format_option.feature
235
245
  - features/command_line/line_number_appended_to_path.feature
236
246
  - features/command_line/line_number_option.feature
247
+ - features/command_line/order.feature
237
248
  - features/command_line/pattern_option.feature
238
249
  - features/command_line/rake_task.feature
239
250
  - features/command_line/ruby.feature
@@ -278,6 +289,7 @@ test_files:
278
289
  - spec/autotest/discover_spec.rb
279
290
  - spec/autotest/failed_results_re_spec.rb
280
291
  - spec/autotest/rspec_spec.rb
292
+ - spec/command_line/order_spec.rb
281
293
  - spec/rspec/core/command_line_configuration_spec.rb
282
294
  - spec/rspec/core/command_line_spec.rb
283
295
  - spec/rspec/core/command_line_spec_output.txt
@@ -285,8 +297,10 @@ test_files:
285
297
  - spec/rspec/core/configuration_spec.rb
286
298
  - spec/rspec/core/deprecations_spec.rb
287
299
  - spec/rspec/core/drb_command_line_spec.rb
300
+ - spec/rspec/core/drb_options_spec.rb
288
301
  - spec/rspec/core/example_group_spec.rb
289
302
  - spec/rspec/core/example_spec.rb
303
+ - spec/rspec/core/filter_manager_spec.rb
290
304
  - spec/rspec/core/formatters/base_formatter_spec.rb
291
305
  - spec/rspec/core/formatters/base_text_formatter_spec.rb
292
306
  - spec/rspec/core/formatters/documentation_formatter_spec.rb
@@ -327,6 +341,8 @@ test_files:
327
341
  - spec/rspec/core/world_spec.rb
328
342
  - spec/rspec/core_spec.rb
329
343
  - spec/spec_helper.rb
344
+ - spec/support/config_options_helper.rb
330
345
  - spec/support/matchers.rb
331
346
  - spec/support/shared_example_groups.rb
332
347
  - spec/support/spec_files.rb
348
+ has_rdoc:
@@ -1,9 +0,0 @@
1
- require 'rspec/expectations'
2
-
3
- module RSpec
4
- module Core
5
- module ExpectationFrameworkAdapter
6
- include RSpec::Matchers
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- require 'test/unit/assertions'
2
-
3
- module RSpec
4
- module Core
5
- module ExpectationFrameworkAdapter
6
- include Test::Unit::Assertions
7
- end
8
- end
9
- end