rspec-core 2.0.0.beta.17 → 2.0.0.beta.18

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 (70) hide show
  1. data/README.markdown +5 -1
  2. data/Rakefile +4 -1
  3. data/Upgrade.markdown +28 -2
  4. data/VERSION +1 -1
  5. data/autotest/discover.rb +1 -1
  6. data/features/command_line/configure.feature +19 -0
  7. data/features/example_groups/shared_example_group.feature +125 -0
  8. data/features/hooks/around_hooks.feature +11 -2
  9. data/features/pending/pending_examples.feature +18 -6
  10. data/lib/autotest/rspec2.rb +1 -1
  11. data/lib/rspec/core.rb +1 -0
  12. data/lib/rspec/core/command_line_configuration.rb +62 -0
  13. data/lib/rspec/core/configuration.rb +39 -12
  14. data/lib/rspec/core/configuration_options.rb +5 -5
  15. data/lib/rspec/core/deprecation.rb +6 -6
  16. data/lib/rspec/core/errors.rb +1 -1
  17. data/lib/rspec/core/example.rb +25 -25
  18. data/lib/rspec/core/example_group.rb +30 -14
  19. data/lib/rspec/core/formatters/base_formatter.rb +25 -25
  20. data/lib/rspec/core/formatters/base_text_formatter.rb +11 -10
  21. data/lib/rspec/core/formatters/documentation_formatter.rb +2 -2
  22. data/lib/rspec/core/formatters/helpers.rb +6 -6
  23. data/lib/rspec/core/formatters/html_formatter.rb +13 -12
  24. data/lib/rspec/core/formatters/progress_formatter.rb +1 -1
  25. data/lib/rspec/core/formatters/snippet_extractor.rb +5 -5
  26. data/lib/rspec/core/hooks.rb +3 -3
  27. data/lib/rspec/core/kernel_extensions.rb +1 -1
  28. data/lib/rspec/core/let.rb +5 -5
  29. data/lib/rspec/core/metadata.rb +2 -2
  30. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +3 -3
  31. data/lib/rspec/core/mocking/with_mocha.rb +5 -5
  32. data/lib/rspec/core/mocking/with_rr.rb +3 -3
  33. data/lib/rspec/core/mocking/with_rspec.rb +3 -3
  34. data/lib/rspec/core/option_parser.rb +8 -4
  35. data/lib/rspec/core/rake_task.rb +5 -0
  36. data/lib/rspec/core/ruby_project.rb +1 -1
  37. data/lib/rspec/core/shared_example_group.rb +2 -2
  38. data/lib/rspec/core/subject.rb +10 -4
  39. data/lib/rspec/core/world.rb +5 -5
  40. data/rspec-core.gemspec +19 -11
  41. data/spec/autotest/rspec_spec.rb +14 -14
  42. data/spec/rspec/core/command_line_configuration_spec.rb +26 -0
  43. data/spec/rspec/core/command_line_spec.rb +5 -5
  44. data/spec/rspec/core/configuration_options_spec.rb +20 -20
  45. data/spec/rspec/core/configuration_spec.rb +10 -10
  46. data/spec/rspec/core/core_spec.rb +8 -8
  47. data/spec/rspec/core/deprecations_spec.rb +2 -2
  48. data/spec/rspec/core/drb_command_line_spec.rb +10 -10
  49. data/spec/rspec/core/example_group_spec.rb +46 -10
  50. data/spec/rspec/core/example_spec.rb +46 -12
  51. data/spec/rspec/core/formatters/base_formatter_spec.rb +2 -46
  52. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +4 -3
  53. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +1 -1
  54. data/spec/rspec/core/formatters/helpers_spec.rb +2 -2
  55. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +1 -1
  56. data/spec/rspec/core/formatters/html_formatted-1.9.1.html +1 -1
  57. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +1 -1
  58. data/spec/rspec/core/formatters/progress_formatter_spec.rb +10 -9
  59. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +13 -13
  60. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +1 -1
  61. data/spec/rspec/core/let_spec.rb +1 -1
  62. data/spec/rspec/core/metadata_spec.rb +9 -9
  63. data/spec/rspec/core/option_parser_spec.rb +3 -3
  64. data/spec/rspec/core/pending_example_spec.rb +1 -1
  65. data/spec/rspec/core/resources/custom_example_group_runner.rb +1 -1
  66. data/spec/rspec/core/runner_spec.rb +4 -4
  67. data/spec/rspec/core/shared_example_group_spec.rb +66 -162
  68. data/spec/rspec/core/subject_spec.rb +4 -4
  69. data/spec/rspec/core/world_spec.rb +38 -38
  70. metadata +21 -13
@@ -10,13 +10,13 @@ module RSpec::Core
10
10
  ExampleGroup.describe(Array).subject.call.should == []
11
11
  end
12
12
  end
13
-
13
+
14
14
  describe "with a Module" do
15
15
  it "returns the Module" do
16
16
  ExampleGroup.describe(Enumerable).subject.call.should == Enumerable
17
17
  end
18
18
  end
19
-
19
+
20
20
  describe "with a string" do
21
21
  it "return the string" do
22
22
  ExampleGroup.describe("Foo").subject.call.should == 'Foo'
@@ -28,9 +28,9 @@ module RSpec::Core
28
28
  ExampleGroup.describe(15).subject.call.should == 15
29
29
  end
30
30
  end
31
-
31
+
32
32
  end
33
-
33
+
34
34
  describe "explicit subject" do
35
35
  describe "defined in a top level group" do
36
36
  it "replaces the implicit subject in that group" do
@@ -6,26 +6,26 @@ class Foo; end
6
6
  module RSpec::Core
7
7
 
8
8
  describe World do
9
-
9
+
10
10
  before do
11
11
  @world = RSpec.world
12
12
  end
13
13
 
14
14
  describe "example_groups" do
15
-
15
+
16
16
  it "should contain all defined example groups" do
17
17
  group = RSpec::Core::ExampleGroup.describe("group") {}
18
18
  @world.example_groups.should include(group)
19
19
  end
20
-
20
+
21
21
  end
22
-
22
+
23
23
  describe "applying inclusion filters" do
24
-
24
+
25
25
  before(:each) do
26
26
  options_1 = { :foo => 1, :color => 'blue', :feature => 'reporting' }
27
27
  options_2 = { :pending => true, :feature => 'reporting' }
28
- options_3 = { :array => [1,2,3,4], :color => 'blue' }
28
+ options_3 = { :array => [1,2,3,4], :color => 'blue' }
29
29
  @bg1 = RSpec::Core::ExampleGroup.describe(Bar, "find group-1", options_1) { }
30
30
  @bg2 = RSpec::Core::ExampleGroup.describe(Bar, "find group-2", options_2) { }
31
31
  @bg3 = RSpec::Core::ExampleGroup.describe(Bar, "find group-3", options_3) { }
@@ -38,70 +38,70 @@ module RSpec::Core
38
38
  end
39
39
  @example_groups = [@bg1, @bg2, @bg3, @bg4]
40
40
  end
41
-
41
+
42
42
  it "finds no groups when given no search parameters" do
43
43
  @world.apply_inclusion_filters([]).should == []
44
44
  end
45
-
45
+
46
46
  it "finds matching groups when filtering on :describes (described class or module)" do
47
47
  @world.apply_inclusion_filters(@example_groups, :example_group => { :describes => Bar }).should == [@bg1, @bg2, @bg3]
48
48
  end
49
-
49
+
50
50
  it "finds matching groups when filtering on :description with text" do
51
51
  @world.apply_inclusion_filters(@example_groups, :example_group => { :description => 'Bar find group-1' }).should == [@bg1]
52
52
  end
53
-
53
+
54
54
  it "finds matching groups when filtering on :description with a lambda" do
55
55
  @world.apply_inclusion_filters(@example_groups, :example_group => { :description => lambda { |v| v.include?('-1') || v.include?('-3') } }).should == [@bg1, @bg3]
56
56
  end
57
-
57
+
58
58
  it "finds matching groups when filtering on :description with a regular expression" do
59
59
  @world.apply_inclusion_filters(@example_groups, :example_group => { :description => /find group/ }).should == [@bg1, @bg2, @bg3]
60
60
  end
61
-
61
+
62
62
  it "finds one group when searching for :pending => true" do
63
63
  @world.apply_inclusion_filters(@example_groups, :pending => true ).should == [@bg2]
64
64
  end
65
-
65
+
66
66
  it "finds matching groups when filtering on arbitrary metadata with a number" do
67
67
  @world.apply_inclusion_filters(@example_groups, :foo => 1 ).should == [@bg1]
68
68
  end
69
-
69
+
70
70
  it "finds matching groups when filtering on arbitrary metadata with an array" do
71
71
  @world.apply_inclusion_filters(@example_groups, :array => [1,2,3,4]).should == [@bg3]
72
72
  end
73
-
73
+
74
74
  it "finds no groups when filtering on arbitrary metadata with an array but the arrays do not match" do
75
75
  @world.apply_inclusion_filters(@example_groups, :array => [4,3,2,1]).should be_empty
76
- end
77
-
76
+ end
77
+
78
78
  it "finds matching examples when filtering on arbitrary metadata" do
79
79
  @world.apply_inclusion_filters(@bg4.examples, :awesome => true).should == [@bg4.examples[1], @bg4.examples[2]]
80
80
  end
81
-
81
+
82
82
  end
83
-
83
+
84
84
  describe "applying exclusion filters" do
85
-
85
+
86
86
  it "should find nothing if all describes match the exclusion filter" do
87
- options = { :network_access => true }
88
-
87
+ options = { :network_access => true }
88
+
89
89
  group1 = ExampleGroup.describe(Bar, "find group-1", options) do
90
90
  it("foo") {}
91
91
  it("bar") {}
92
92
  end
93
-
93
+
94
94
  @world.apply_exclusion_filters(group1.examples, :network_access => true).should == []
95
-
95
+
96
96
  group2 = ExampleGroup.describe(Bar, "find group-1") do
97
97
  it("foo", :network_access => true) {}
98
98
  it("bar") {}
99
99
  end
100
-
100
+
101
101
  @world.apply_exclusion_filters(group2.examples, :network_access => true).should == [group2.examples.last]
102
-
102
+
103
103
  end
104
-
104
+
105
105
  it "should find nothing if a regexp matches the exclusion filter" do
106
106
  group = ExampleGroup.describe(Bar, "find group-1", :name => "exclude me with a regex", :another => "foo") do
107
107
  it("foo") {}
@@ -111,13 +111,13 @@ module RSpec::Core
111
111
  @world.apply_exclusion_filters(group.examples, :name => /exclude/, :another => "foo").should == []
112
112
  @world.apply_exclusion_filters(group.examples, :name => /exclude/, :another => "foo", :example_group => {
113
113
  :describes => lambda { |b| b == Bar } } ).should == []
114
-
114
+
115
115
  @world.apply_exclusion_filters(group.examples, :name => /exclude not/).should == group.examples
116
116
  @world.apply_exclusion_filters(group.examples, :name => /exclude/, "another_condition" => "foo").should == group.examples
117
117
  @world.apply_exclusion_filters(group.examples, :name => /exclude/, "another_condition" => "foo1").should == group.examples
118
118
  end
119
119
  end
120
-
120
+
121
121
 
122
122
  describe "preceding_declaration_line" do
123
123
  before(:each) do
@@ -125,7 +125,7 @@ module RSpec::Core
125
125
  @group2_line = 20
126
126
  @group2_example1_line = 30
127
127
  @group2_example2_line = 40
128
-
128
+
129
129
  @group1 = RSpec::Core::ExampleGroup.describe(Bar, "group-1") { }
130
130
  @group2 = RSpec::Core::ExampleGroup.describe(Bar, "group-2") do
131
131
  it('example 1') {}
@@ -136,27 +136,27 @@ module RSpec::Core
136
136
  @group2.examples[0].metadata[:line_number] = @group2_example1_line
137
137
  @group2.examples[1].metadata[:line_number] = @group2_example2_line
138
138
  end
139
-
140
- it "should return nil if no example or group precedes the line" do
139
+
140
+ it "should return nil if no example or group precedes the line" do
141
141
  @world.preceding_declaration_line(@group1_line-1).should == nil
142
142
  end
143
-
143
+
144
144
  it "should return the argument line number if a group starts on that line" do
145
145
  @world.preceding_declaration_line(@group1_line).should == @group1_line
146
146
  end
147
-
147
+
148
148
  it "should return the argument line number if an example starts on that line" do
149
149
  @world.preceding_declaration_line(@group2_example1_line).should == @group2_example1_line
150
150
  end
151
-
151
+
152
152
  it "should return line number of a group that immediately precedes the argument line" do
153
153
  @world.preceding_declaration_line(@group2_line+1).should == @group2_line
154
154
  end
155
-
155
+
156
156
  it "should return line number of an example that immediately precedes the argument line" do
157
- @world.preceding_declaration_line(@group2_example1_line+1).should == @group2_example1_line
157
+ @world.preceding_declaration_line(@group2_example1_line+1).should == @group2_example1_line
158
158
  end
159
-
159
+
160
160
  end
161
161
  end
162
162
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196417
4
+ hash: 62196423
5
5
  prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 17
12
- version: 2.0.0.beta.17
11
+ - 18
12
+ version: 2.0.0.beta.18
13
13
  platform: ruby
14
14
  authors:
15
15
  - Chad Humphries
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-07-11 00:00:00 -05:00
21
+ date: 2010-07-21 00:00:00 -05:00
22
22
  default_executable: rspec
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- hash: 62196417
33
+ hash: 62196423
34
34
  segments:
35
35
  - 2
36
36
  - 0
37
37
  - 0
38
38
  - beta
39
- - 17
40
- version: 2.0.0.beta.17
39
+ - 18
40
+ version: 2.0.0.beta.18
41
41
  requirement: *id001
42
42
  - !ruby/object:Gem::Dependency
43
43
  type: :development
@@ -48,14 +48,14 @@ dependencies:
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- hash: 62196417
51
+ hash: 62196423
52
52
  segments:
53
53
  - 2
54
54
  - 0
55
55
  - 0
56
56
  - beta
57
- - 17
58
- version: 2.0.0.beta.17
57
+ - 18
58
+ version: 2.0.0.beta.18
59
59
  requirement: *id002
60
60
  - !ruby/object:Gem::Dependency
61
61
  type: :development
@@ -112,6 +112,7 @@ files:
112
112
  - bin/rspec
113
113
  - cucumber.yml
114
114
  - features/README.markdown
115
+ - features/command_line/configure.feature
115
116
  - features/command_line/example_name_option.feature
116
117
  - features/command_line/exit_status.feature
117
118
  - features/command_line/line_number_appended_to_path.feature
@@ -120,6 +121,7 @@ files:
120
121
  - features/configuration/options_file.feature
121
122
  - features/example_groups/describe_aliases.feature
122
123
  - features/example_groups/nested_groups.feature
124
+ - features/example_groups/shared_example_group.feature
123
125
  - features/filtering/inclusion_filters.feature
124
126
  - features/formatters/custom_formatter.feature
125
127
  - features/hooks/around_hooks.feature
@@ -140,6 +142,7 @@ files:
140
142
  - lib/rspec/core/around_proxy.rb
141
143
  - lib/rspec/core/backward_compatibility.rb
142
144
  - lib/rspec/core/command_line.rb
145
+ - lib/rspec/core/command_line_configuration.rb
143
146
  - lib/rspec/core/configuration.rb
144
147
  - lib/rspec/core/configuration_options.rb
145
148
  - lib/rspec/core/deprecation.rb
@@ -182,6 +185,7 @@ files:
182
185
  - script/console
183
186
  - spec/autotest/failed_results_re_spec.rb
184
187
  - spec/autotest/rspec_spec.rb
188
+ - spec/rspec/core/command_line_configuration_spec.rb
185
189
  - spec/rspec/core/command_line_spec.rb
186
190
  - spec/rspec/core/command_line_spec_output.txt
187
191
  - spec/rspec/core/configuration_options_spec.rb
@@ -232,8 +236,11 @@ licenses: []
232
236
  post_install_message: |
233
237
  **************************************************
234
238
 
235
- Thank you for installing rspec-core-2.0.0.beta.17
236
-
239
+ Thank you for installing rspec-core-2.0.0.beta.18
240
+
241
+ Please be sure to look at Upgrade.markdown to see what might have changed
242
+ since the last release.
243
+
237
244
  **************************************************
238
245
 
239
246
  rdoc_options:
@@ -266,10 +273,11 @@ rubyforge_project: rspec
266
273
  rubygems_version: 1.3.7
267
274
  signing_key:
268
275
  specification_version: 3
269
- summary: rspec-core-2.0.0.beta.17
276
+ summary: rspec-core-2.0.0.beta.18
270
277
  test_files:
271
278
  - spec/autotest/failed_results_re_spec.rb
272
279
  - spec/autotest/rspec_spec.rb
280
+ - spec/rspec/core/command_line_configuration_spec.rb
273
281
  - spec/rspec/core/command_line_spec.rb
274
282
  - spec/rspec/core/configuration_options_spec.rb
275
283
  - spec/rspec/core/configuration_spec.rb