rspec-core 2.0.0.beta.20 → 2.0.0.beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. data/.rspec +1 -1
  2. data/Gemfile +7 -6
  3. data/History.md +30 -0
  4. data/Rakefile +3 -43
  5. data/bin/rspec +2 -1
  6. data/features/configuration/{options_file.feature → read_options_from_file.feature} +29 -25
  7. data/features/example_groups/shared_example_group.feature +10 -6
  8. data/features/hooks/before_and_after_hooks.feature +38 -0
  9. data/lib/autotest/rspec2.rb +10 -2
  10. data/lib/rspec/core.rb +8 -0
  11. data/lib/rspec/core/configuration.rb +16 -10
  12. data/lib/rspec/core/configuration_options.rb +7 -3
  13. data/lib/rspec/core/example.rb +7 -0
  14. data/lib/rspec/core/example_group.rb +15 -2
  15. data/lib/rspec/core/extensions/module_eval_with_args.rb +9 -29
  16. data/lib/rspec/core/extensions/object.rb +0 -2
  17. data/lib/rspec/core/formatters/base_formatter.rb +8 -6
  18. data/lib/rspec/core/formatters/base_text_formatter.rb +18 -10
  19. data/lib/rspec/core/formatters/documentation_formatter.rb +9 -9
  20. data/lib/rspec/core/option_parser.rb +0 -4
  21. data/lib/rspec/core/rake_task.rb +85 -39
  22. data/lib/rspec/core/reporter.rb +18 -5
  23. data/lib/rspec/core/runner.rb +8 -18
  24. data/lib/rspec/core/shared_example_group.rb +2 -1
  25. data/lib/rspec/core/version.rb +1 -1
  26. data/rspec-core.gemspec +33 -233
  27. data/spec/autotest/failed_results_re_spec.rb +1 -2
  28. data/spec/autotest/rspec_spec.rb +62 -42
  29. data/spec/rspec/core/configuration_options_spec.rb +12 -29
  30. data/spec/rspec/core/configuration_spec.rb +8 -8
  31. data/spec/rspec/core/example_group_spec.rb +38 -7
  32. data/spec/rspec/core/example_spec.rb +16 -1
  33. data/spec/rspec/core/formatters/base_formatter_spec.rb +6 -0
  34. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +125 -10
  35. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +36 -0
  36. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +282 -0
  37. data/spec/rspec/core/formatters/html_formatted-1.9.1.html +22 -2
  38. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +280 -0
  39. data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +280 -0
  40. data/spec/rspec/core/rake_task_spec.rb +128 -0
  41. data/spec/rspec/core/reporter_spec.rb +36 -0
  42. data/spec/rspec/core/runner_spec.rb +0 -18
  43. data/spec/rspec/core/shared_example_group_spec.rb +22 -2
  44. data/spec/rspec/core/world_spec.rb +13 -15
  45. data/spec/spec_helper.rb +2 -1
  46. metadata +110 -13
  47. data/VERSION +0 -1
  48. data/lib/rspec/autorun.rb +0 -2
@@ -2,24 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  module RSpec::Core
4
4
  describe Runner do
5
- describe 'at_exit' do
6
- it 'sets an at_exit hook if none is already set' do
7
- RSpec::Core::Runner.stub(:installed_at_exit?).and_return(false)
8
- RSpec::Core::Runner.stub(:running_in_drb?).and_return(false)
9
- RSpec::Core::Runner.stub(:at_exit_hook_disabled?).and_return(false)
10
- RSpec::Core::Runner.should_receive(:at_exit)
11
- RSpec::Core::Runner.autorun
12
- end
13
-
14
- it 'does not set the at_exit hook if it is already set' do
15
- RSpec::Core::Runner.stub(:installed_at_exit?).and_return(true)
16
- RSpec::Core::Runner.stub(:running_in_drb?).and_return(false)
17
- RSpec::Core::Runner.stub(:at_exit_hook_disabled?).and_return(false)
18
- RSpec::Core::Runner.should_receive(:at_exit).never
19
- RSpec::Core::Runner.autorun
20
- end
21
- end
22
-
23
5
  describe "#run" do
24
6
  context "with --drb or -X" do
25
7
  before(:each) do
@@ -40,8 +40,11 @@ module RSpec::Core
40
40
  end
41
41
  end
42
42
  group = ExampleGroup.describe('group') { include Cornucopia }
43
- group.examples.length.should == 1
44
- group.examples.first.metadata[:description].should == "is plentiful"
43
+ phantom_group = group.children.first
44
+ phantom_group.description.should eql("")
45
+ phantom_group.metadata[:shared_group_name].should eql('Cornucopia')
46
+ phantom_group.examples.length.should == 1
47
+ phantom_group.examples.first.metadata[:description].should == "is plentiful"
45
48
  end
46
49
  end
47
50
 
@@ -98,6 +101,23 @@ module RSpec::Core
98
101
 
99
102
  passed_params.should == { :param1 => :value1, :param2 => :value2 }
100
103
  end
104
+
105
+ it "adds shared instance methods to nested group" do
106
+ shared_examples_for("thing") do |param1|
107
+ def foo; end
108
+ end
109
+ group = ExampleGroup.describe('fake group')
110
+ shared_group = group.it_should_behave_like("thing", :a)
111
+ shared_group.public_instance_methods.map{|m| m.to_s}.should include("foo")
112
+ end
113
+
114
+ it "evals the shared example group only once" do
115
+ eval_count = 0
116
+ shared_examples_for("thing") { |p| eval_count += 1 }
117
+ group = ExampleGroup.describe('fake group')
118
+ shared_group = group.it_should_behave_like("thing", :a)
119
+ eval_count.should == 1
120
+ end
101
121
  end
102
122
 
103
123
  context "given a block" do
@@ -26,17 +26,17 @@ module RSpec::Core
26
26
  options_1 = { :foo => 1, :color => 'blue', :feature => 'reporting' }
27
27
  options_2 = { :pending => true, :feature => 'reporting' }
28
28
  options_3 = { :array => [1,2,3,4], :color => 'blue' }
29
- @bg1 = RSpec::Core::ExampleGroup.describe(Bar, "find group-1", options_1) { }
30
- @bg2 = RSpec::Core::ExampleGroup.describe(Bar, "find group-2", options_2) { }
31
- @bg3 = RSpec::Core::ExampleGroup.describe(Bar, "find group-3", options_3) { }
32
- @bg4 = RSpec::Core::ExampleGroup.describe(Foo, "find these examples") do
29
+ @group1 = RSpec::Core::ExampleGroup.describe(Bar, "find group-1", options_1) { }
30
+ @group2 = RSpec::Core::ExampleGroup.describe(Bar, "find group-2", options_2) { }
31
+ @group3 = RSpec::Core::ExampleGroup.describe(Bar, "find group-3", options_3) { }
32
+ @group4 = RSpec::Core::ExampleGroup.describe(Foo, "find these examples") do
33
33
  it('I have no options') {}
34
34
  it("this is awesome", :awesome => true) {}
35
35
  it("this is too", :awesome => true) {}
36
36
  it("not so awesome", :awesome => false) {}
37
37
  it("I also have no options") {}
38
38
  end
39
- @example_groups = [@bg1, @bg2, @bg3, @bg4]
39
+ @example_groups = [@group1, @group2, @group3, @group4]
40
40
  end
41
41
 
42
42
  it "finds no groups when given no search parameters" do
@@ -44,33 +44,31 @@ module RSpec::Core
44
44
  end
45
45
 
46
46
  it "finds matching groups when filtering on :describes (described class or module)" do
47
- @world.apply_inclusion_filters(@example_groups, :example_group => { :describes => Bar }).should == [@bg1, @bg2, @bg3]
47
+ @world.apply_inclusion_filters(@example_groups, :example_group => { :describes => Bar }).should == [@group1, @group2, @group3]
48
48
  end
49
49
 
50
50
  it "finds matching groups when filtering on :description with text" do
51
- @world.apply_inclusion_filters(@example_groups, :example_group => { :description => 'Bar find group-1' }).should == [@bg1]
51
+ @world.apply_inclusion_filters(@example_groups, :example_group => { :description => 'Bar find group-1' }).should == [@group1]
52
52
  end
53
53
 
54
54
  it "finds matching groups when filtering on :description with a lambda" do
55
- @world.apply_inclusion_filters(@example_groups, :example_group => { :description => lambda { |v| v.include?('-1') || v.include?('-3') } }).should == [@bg1, @bg3]
55
+ @world.apply_inclusion_filters(@example_groups, :example_group => { :description => lambda { |v| v.include?('-1') || v.include?('-3') } }).should == [@group1, @group3]
56
56
  end
57
57
 
58
58
  it "finds matching groups when filtering on :description with a regular expression" do
59
- @world.apply_inclusion_filters(@example_groups, :example_group => { :description => /find group/ }).should == [@bg1, @bg2, @bg3]
59
+ @world.apply_inclusion_filters(@example_groups, :example_group => { :description => /find group/ }).should == [@group1, @group2, @group3]
60
60
  end
61
61
 
62
62
  it "finds one group when searching for :pending => true" do
63
- @world.apply_inclusion_filters(@example_groups, :pending => true ).should == [@bg2]
63
+ @world.apply_inclusion_filters(@example_groups, :pending => true ).should == [@group2]
64
64
  end
65
65
 
66
66
  it "finds matching groups when filtering on arbitrary metadata with a number" do
67
- pending("discover why this example fails when the whole suite is run, but passes when just this group is run") do
68
- @world.apply_inclusion_filters(@example_groups, :foo => 1 ).should == [@bg1]
69
- end
67
+ @world.apply_inclusion_filters(@example_groups, :foo => 1 ).should == [@group1]
70
68
  end
71
69
 
72
70
  it "finds matching groups when filtering on arbitrary metadata with an array" do
73
- @world.apply_inclusion_filters(@example_groups, :array => [1,2,3,4]).should == [@bg3]
71
+ @world.apply_inclusion_filters(@example_groups, :array => [1,2,3,4]).should == [@group3]
74
72
  end
75
73
 
76
74
  it "finds no groups when filtering on arbitrary metadata with an array but the arrays do not match" do
@@ -78,7 +76,7 @@ module RSpec::Core
78
76
  end
79
77
 
80
78
  it "finds matching examples when filtering on arbitrary metadata" do
81
- @world.apply_inclusion_filters(@bg4.examples, :awesome => true).should == [@bg4.examples[1], @bg4.examples[2]]
79
+ @world.apply_inclusion_filters(@group4.examples, :awesome => true).should == [@group4.examples[1], @group4.examples[2]]
82
80
  end
83
81
 
84
82
  end
@@ -34,6 +34,7 @@ def sandboxed(&block)
34
34
  @orig_config = RSpec.configuration
35
35
  @orig_world = RSpec.world
36
36
  new_config = RSpec::Core::Configuration.new
37
+ new_config.include(RSpec::Matchers)
37
38
  new_world = RSpec::Core::World.new(new_config)
38
39
  RSpec.instance_variable_set(:@configuration, new_config)
39
40
  RSpec.instance_variable_set(:@world, new_world)
@@ -54,7 +55,7 @@ end
54
55
 
55
56
  RSpec.configure do |c|
56
57
  c.color_enabled = !in_editor?
57
- c.filter_run :focus => true
58
+ c.filter_run :focused => true
58
59
  c.run_all_when_everything_filtered = true
59
60
  c.filter_run_excluding :ruby => lambda {|version|
60
61
  case version.to_s
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 20
11
- version: 2.0.0.beta.20
10
+ - 22
11
+ version: 2.0.0.beta.22
12
12
  platform: ruby
13
13
  authors:
14
14
  - Chad Humphries
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-08-24 00:00:00 -05:00
20
+ date: 2010-09-12 00:00:00 -05:00
21
21
  default_executable: rspec
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -32,8 +32,8 @@ dependencies:
32
32
  - 0
33
33
  - 0
34
34
  - beta
35
- - 20
36
- version: 2.0.0.beta.20
35
+ - 22
36
+ version: 2.0.0.beta.22
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: *id001
@@ -49,8 +49,8 @@ dependencies:
49
49
  - 0
50
50
  - 0
51
51
  - beta
52
- - 20
53
- version: 2.0.0.beta.20
52
+ - 22
53
+ version: 2.0.0.beta.22
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: *id002
@@ -84,6 +84,60 @@ dependencies:
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: *id004
87
+ - !ruby/object:Gem::Dependency
88
+ name: syntax
89
+ requirement: &id005 !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ segments:
95
+ - 1
96
+ - 0
97
+ - 0
98
+ version: 1.0.0
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: *id005
102
+ - !ruby/object:Gem::Dependency
103
+ name: flexmock
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: *id006
115
+ - !ruby/object:Gem::Dependency
116
+ name: mocha
117
+ requirement: &id007 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ segments:
123
+ - 0
124
+ version: "0"
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: *id007
128
+ - !ruby/object:Gem::Dependency
129
+ name: rr
130
+ requirement: &id008 !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ segments:
136
+ - 0
137
+ version: "0"
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: *id008
87
141
  description: RSpec runner and example groups
88
142
  email: dchelimsky@gmail.com;chad.humphries@gmail.com
89
143
  executables:
@@ -98,11 +152,11 @@ files:
98
152
  - .rspec
99
153
  - .treasure_map.rb
100
154
  - Gemfile
155
+ - History.md
101
156
  - License.txt
102
157
  - README.markdown
103
158
  - Rakefile
104
159
  - Upgrade.markdown
105
- - VERSION
106
160
  - autotest/discover.rb
107
161
  - bin/rspec
108
162
  - cucumber.yml
@@ -113,7 +167,7 @@ files:
113
167
  - features/command_line/line_number_appended_to_path.feature
114
168
  - features/command_line/line_number_option.feature
115
169
  - features/configuration/custom_settings.feature
116
- - features/configuration/options_file.feature
170
+ - features/configuration/read_options_from_file.feature
117
171
  - features/example_groups/describe_aliases.feature
118
172
  - features/example_groups/nested_groups.feature
119
173
  - features/example_groups/shared_example_group.feature
@@ -135,7 +189,6 @@ files:
135
189
  - features/subject/implicit_subject.feature
136
190
  - features/support/env.rb
137
191
  - lib/autotest/rspec2.rb
138
- - lib/rspec/autorun.rb
139
192
  - lib/rspec/core.rb
140
193
  - lib/rspec/core/around_proxy.rb
141
194
  - lib/rspec/core/backward_compatibility.rb
@@ -201,6 +254,7 @@ files:
201
254
  - spec/rspec/core/formatters/documentation_formatter_spec.rb
202
255
  - spec/rspec/core/formatters/helpers_spec.rb
203
256
  - spec/rspec/core/formatters/html_formatted-1.8.6.html
257
+ - spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html
204
258
  - spec/rspec/core/formatters/html_formatted-1.8.7.html
205
259
  - spec/rspec/core/formatters/html_formatted-1.9.1.html
206
260
  - spec/rspec/core/formatters/html_formatted-1.9.2.html
@@ -208,7 +262,9 @@ files:
208
262
  - spec/rspec/core/formatters/progress_formatter_spec.rb
209
263
  - spec/rspec/core/formatters/snippet_extractor_spec.rb
210
264
  - spec/rspec/core/formatters/text_mate_formatted-1.8.6.html
265
+ - spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html
211
266
  - spec/rspec/core/formatters/text_mate_formatted-1.8.7.html
267
+ - spec/rspec/core/formatters/text_mate_formatted-1.9.1.html
212
268
  - spec/rspec/core/formatters/text_mate_formatted-1.9.2.html
213
269
  - spec/rspec/core/formatters/text_mate_formatter_spec.rb
214
270
  - spec/rspec/core/hooks_filtering_spec.rb
@@ -218,6 +274,7 @@ files:
218
274
  - spec/rspec/core/metadata_spec.rb
219
275
  - spec/rspec/core/option_parser_spec.rb
220
276
  - spec/rspec/core/pending_example_spec.rb
277
+ - spec/rspec/core/rake_task_spec.rb
221
278
  - spec/rspec/core/reporter_spec.rb
222
279
  - spec/rspec/core/resources/a_bar.rb
223
280
  - spec/rspec/core/resources/a_foo.rb
@@ -242,7 +299,7 @@ licenses: []
242
299
  post_install_message: |
243
300
  **************************************************
244
301
 
245
- Thank you for installing rspec-core-2.0.0.beta.20
302
+ Thank you for installing rspec-core-2.0.0.beta.22
246
303
 
247
304
  Please be sure to look at Upgrade.markdown to see what might have changed
248
305
  since the last release.
@@ -258,7 +315,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
315
  requirements:
259
316
  - - ">="
260
317
  - !ruby/object:Gem::Version
261
- hash: 2409233912150691579
318
+ hash: 2227276368104417494
262
319
  segments:
263
320
  - 0
264
321
  version: "0"
@@ -278,12 +335,41 @@ rubyforge_project: rspec
278
335
  rubygems_version: 1.3.7
279
336
  signing_key:
280
337
  specification_version: 3
281
- summary: rspec-core-2.0.0.beta.20
338
+ summary: rspec-core-2.0.0.beta.22
282
339
  test_files:
340
+ - features/README.markdown
341
+ - features/command_line/configure.feature
342
+ - features/command_line/example_name_option.feature
343
+ - features/command_line/exit_status.feature
344
+ - features/command_line/line_number_appended_to_path.feature
345
+ - features/command_line/line_number_option.feature
346
+ - features/configuration/custom_settings.feature
347
+ - features/configuration/read_options_from_file.feature
348
+ - features/example_groups/describe_aliases.feature
349
+ - features/example_groups/nested_groups.feature
350
+ - features/example_groups/shared_example_group.feature
351
+ - features/filtering/exclusion_filters.feature
352
+ - features/filtering/inclusion_filters.feature
353
+ - features/formatters/custom_formatter.feature
354
+ - features/hooks/around_hooks.feature
355
+ - features/hooks/before_and_after_hooks.feature
356
+ - features/hooks/described_class.feature
357
+ - features/hooks/halt.feature
358
+ - features/mock_framework_integration/use_flexmock.feature
359
+ - features/mock_framework_integration/use_mocha.feature
360
+ - features/mock_framework_integration/use_rr.feature
361
+ - features/mock_framework_integration/use_rspec.feature
362
+ - features/pending/pending_examples.feature
363
+ - features/spec_files/arbitrary_file_suffix.feature
364
+ - features/subject/attribute_of_subject.feature
365
+ - features/subject/explicit_subject.feature
366
+ - features/subject/implicit_subject.feature
367
+ - features/support/env.rb
283
368
  - spec/autotest/failed_results_re_spec.rb
284
369
  - spec/autotest/rspec_spec.rb
285
370
  - spec/rspec/core/command_line_configuration_spec.rb
286
371
  - spec/rspec/core/command_line_spec.rb
372
+ - spec/rspec/core/command_line_spec_output.txt
287
373
  - spec/rspec/core/configuration_options_spec.rb
288
374
  - spec/rspec/core/configuration_spec.rb
289
375
  - spec/rspec/core/deprecations_spec.rb
@@ -294,9 +380,19 @@ test_files:
294
380
  - spec/rspec/core/formatters/base_text_formatter_spec.rb
295
381
  - spec/rspec/core/formatters/documentation_formatter_spec.rb
296
382
  - spec/rspec/core/formatters/helpers_spec.rb
383
+ - spec/rspec/core/formatters/html_formatted-1.8.6.html
384
+ - spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html
385
+ - spec/rspec/core/formatters/html_formatted-1.8.7.html
386
+ - spec/rspec/core/formatters/html_formatted-1.9.1.html
387
+ - spec/rspec/core/formatters/html_formatted-1.9.2.html
297
388
  - spec/rspec/core/formatters/html_formatter_spec.rb
298
389
  - spec/rspec/core/formatters/progress_formatter_spec.rb
299
390
  - spec/rspec/core/formatters/snippet_extractor_spec.rb
391
+ - spec/rspec/core/formatters/text_mate_formatted-1.8.6.html
392
+ - spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html
393
+ - spec/rspec/core/formatters/text_mate_formatted-1.8.7.html
394
+ - spec/rspec/core/formatters/text_mate_formatted-1.9.1.html
395
+ - spec/rspec/core/formatters/text_mate_formatted-1.9.2.html
300
396
  - spec/rspec/core/formatters/text_mate_formatter_spec.rb
301
397
  - spec/rspec/core/hooks_filtering_spec.rb
302
398
  - spec/rspec/core/hooks_spec.rb
@@ -305,6 +401,7 @@ test_files:
305
401
  - spec/rspec/core/metadata_spec.rb
306
402
  - spec/rspec/core/option_parser_spec.rb
307
403
  - spec/rspec/core/pending_example_spec.rb
404
+ - spec/rspec/core/rake_task_spec.rb
308
405
  - spec/rspec/core/reporter_spec.rb
309
406
  - spec/rspec/core/resources/a_bar.rb
310
407
  - spec/rspec/core/resources/a_foo.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 2.0.0.beta.20
@@ -1,2 +0,0 @@
1
- require 'rspec/core'
2
- RSpec::Core::Runner.autorun