rspec-core 2.0.0.beta.6 → 2.0.0.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/features/command_line/line_number_appended_to_path.feature +52 -1
- data/lib/rspec/core/configuration_options.rb +1 -1
- data/lib/rspec/core/example_group.rb +25 -22
- data/lib/rspec/core/formatters/base_formatter.rb +2 -2
- data/lib/rspec/core/let.rb +5 -0
- data/lib/rspec/core/metadata.rb +6 -1
- data/lib/rspec/core/world.rb +43 -41
- data/rspec-core.gemspec +10 -10
- data/spec/rspec/core/example_group_spec.rb +19 -0
- data/spec/rspec/core/metadata_spec.rb +34 -4
- data/spec/rspec/core/world_spec.rb +40 -1
- metadata +9 -9
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.beta.
|
1
|
+
2.0.0.beta.7
|
@@ -37,9 +37,23 @@ Feature: line number appended to file path
|
|
37
37
|
And I should see "example in nested group"
|
38
38
|
|
39
39
|
@wip
|
40
|
+
Scenario: nested groups - outer group inside block before example
|
41
|
+
When I run "rspec example_spec.rb:2 --format doc"
|
42
|
+
Then I should see "3 examples, 0 failures"
|
43
|
+
And I should see "second example in outer group"
|
44
|
+
And I should see "first example in outer group"
|
45
|
+
And I should see "example in nested group"
|
46
|
+
|
40
47
|
Scenario: nested groups - inner group on declaration line
|
41
48
|
When I run "rspec example_spec.rb:11 --format doc"
|
42
|
-
Then I should see "
|
49
|
+
Then I should see "1 example, 0 failures"
|
50
|
+
And I should see "example in nested group"
|
51
|
+
And I should not see "second example in outer group"
|
52
|
+
And I should not see "first example in outer group"
|
53
|
+
|
54
|
+
Scenario: nested groups - inner group inside block before example
|
55
|
+
When I run "rspec example_spec.rb:12 --format doc"
|
56
|
+
Then I should see "1 example, 0 failures"
|
43
57
|
And I should see "example in nested group"
|
44
58
|
And I should not see "second example in outer group"
|
45
59
|
And I should not see "first example in outer group"
|
@@ -51,9 +65,46 @@ Feature: line number appended to file path
|
|
51
65
|
But I should not see "second example in outer group"
|
52
66
|
And I should not see "example in nested group"
|
53
67
|
|
68
|
+
Scenario: two examples - first example inside block
|
69
|
+
When I run "rspec example_spec.rb:4 --format doc"
|
70
|
+
Then I should see "1 example, 0 failures"
|
71
|
+
And I should see "first example in outer group"
|
72
|
+
But I should not see "second example in outer group"
|
73
|
+
And I should not see "example in nested group"
|
74
|
+
|
75
|
+
Scenario: two examples - first example on end
|
76
|
+
When I run "rspec example_spec.rb:5 --format doc"
|
77
|
+
Then I should see "1 example, 0 failures"
|
78
|
+
And I should see "first example in outer group"
|
79
|
+
But I should not see "second example in outer group"
|
80
|
+
And I should not see "example in nested group"
|
81
|
+
|
82
|
+
Scenario: two examples - first example after end but before next example
|
83
|
+
When I run "rspec example_spec.rb:6 --format doc"
|
84
|
+
Then I should see "1 example, 0 failures"
|
85
|
+
And I should see "first example in outer group"
|
86
|
+
But I should not see "second example in outer group"
|
87
|
+
And I should not see "example in nested group"
|
88
|
+
|
54
89
|
Scenario: two examples - second example on declaration line
|
55
90
|
When I run "rspec example_spec.rb:7 --format doc"
|
56
91
|
Then I should see "1 example, 0 failures"
|
57
92
|
And I should see "second example in outer group"
|
58
93
|
But I should not see "first example in outer group"
|
59
94
|
And I should not see "example in nested group"
|
95
|
+
|
96
|
+
Scenario: two examples - second example inside block
|
97
|
+
When I run "rspec example_spec.rb:7 --format doc"
|
98
|
+
Then I should see "1 example, 0 failures"
|
99
|
+
And I should see "second example in outer group"
|
100
|
+
But I should not see "first example in outer group"
|
101
|
+
And I should not see "example in nested group"
|
102
|
+
|
103
|
+
Scenario: two examples - second example on end
|
104
|
+
When I run "rspec example_spec.rb:7 --format doc"
|
105
|
+
Then I should see "1 example, 0 failures"
|
106
|
+
And I should see "second example in outer group"
|
107
|
+
But I should not see "first example in outer group"
|
108
|
+
And I should not see "example in nested group"
|
109
|
+
|
110
|
+
|
@@ -30,7 +30,7 @@ module Rspec
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def merged_options
|
33
|
-
[global_options, local_options, command_line_options].inject
|
33
|
+
[global_options, local_options, command_line_options].inject do |merged, options|
|
34
34
|
merged.merge(options)
|
35
35
|
end
|
36
36
|
end
|
@@ -17,22 +17,21 @@ module Rspec
|
|
17
17
|
ancestors.select { |mod| mod.class == Module } - [ Object, Kernel ]
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
def self.define_example_method(name, extra_options={})
|
21
|
+
module_eval(<<-END_RUBY, __FILE__, __LINE__)
|
22
|
+
def self.#{name}(desc=nil, options={}, &block)
|
23
|
+
options.update(:pending => true) unless block
|
24
|
+
options.update(:caller => caller)
|
25
|
+
options.update(#{extra_options.inspect})
|
26
|
+
examples << Rspec::Core::Example.new(self, desc, options, block)
|
27
|
+
end
|
28
|
+
END_RUBY
|
24
29
|
end
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
options.update(:caller => caller)
|
31
|
-
options.update(#{extra_options.inspect})
|
32
|
-
examples << Rspec::Core::Example.new(self, desc, options, block)
|
33
|
-
end
|
34
|
-
END_RUBY
|
35
|
-
module_eval(new_alias, __FILE__, __LINE__)
|
31
|
+
define_example_method :example
|
32
|
+
|
33
|
+
class << self
|
34
|
+
alias_method :alias_example_to, :define_example_method
|
36
35
|
end
|
37
36
|
|
38
37
|
alias_example_to :it
|
@@ -128,14 +127,13 @@ module Rspec
|
|
128
127
|
end
|
129
128
|
|
130
129
|
def self.ancestors(superclass_last=false)
|
131
|
-
classes = []
|
132
130
|
current_class = self
|
133
131
|
|
132
|
+
classes = []
|
134
133
|
while current_class < Rspec::Core::ExampleGroup
|
135
134
|
superclass_last ? classes << current_class : classes.unshift(current_class)
|
136
135
|
current_class = current_class.superclass
|
137
136
|
end
|
138
|
-
|
139
137
|
classes
|
140
138
|
end
|
141
139
|
|
@@ -188,12 +186,12 @@ module Rspec
|
|
188
186
|
end
|
189
187
|
|
190
188
|
# Runs all examples, returning true only if all of them pass
|
191
|
-
def self.run_examples(
|
192
|
-
examples_to_run.map do |
|
193
|
-
|
194
|
-
|
195
|
-
before_all_ivars.each {
|
196
|
-
|
189
|
+
def self.run_examples(instance, reporter)
|
190
|
+
examples_to_run.map do |example|
|
191
|
+
success = example.run(instance, reporter)
|
192
|
+
instance.__reset__
|
193
|
+
before_all_ivars.each {|k, v| instance.instance_variable_set(k, v)}
|
194
|
+
success
|
197
195
|
end.all?
|
198
196
|
end
|
199
197
|
|
@@ -205,6 +203,11 @@ module Rspec
|
|
205
203
|
metadata.all_apply?(filters)
|
206
204
|
end
|
207
205
|
|
206
|
+
def self.declaration_line_numbers
|
207
|
+
[metadata[:example_group][:line_number]] +
|
208
|
+
examples.collect {|e| e.metadata[:line_number]}
|
209
|
+
end
|
210
|
+
|
208
211
|
def described_class
|
209
212
|
self.class.describes
|
210
213
|
end
|
@@ -18,11 +18,11 @@ module Rspec
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def pending_examples
|
21
|
-
@pending_examples ||= ::Rspec::Core.world.find(examples, :
|
21
|
+
@pending_examples ||= ::Rspec::Core.world.find(examples, :execution_result => { :status => 'pending' })
|
22
22
|
end
|
23
23
|
|
24
24
|
def failed_examples
|
25
|
-
@failed_examples ||= ::Rspec::Core.world.find(examples, :
|
25
|
+
@failed_examples ||= ::Rspec::Core.world.find(examples, :execution_result => { :status => 'failed' })
|
26
26
|
end
|
27
27
|
|
28
28
|
def report(count)
|
data/lib/rspec/core/let.rb
CHANGED
data/lib/rspec/core/metadata.rb
CHANGED
@@ -94,7 +94,8 @@ EOM
|
|
94
94
|
filter.call(metadata[filter_on]) rescue false
|
95
95
|
when Fixnum
|
96
96
|
if filter_on == :line_number
|
97
|
-
[metadata[:line_number],metadata[:example_group][:line_number]].
|
97
|
+
[metadata[:line_number], metadata[:example_group][:line_number]].
|
98
|
+
include?(world.preceding_example_or_group_line(filter))
|
98
99
|
else
|
99
100
|
metadata[filter_on] == filter
|
100
101
|
end
|
@@ -105,6 +106,10 @@ EOM
|
|
105
106
|
|
106
107
|
private
|
107
108
|
|
109
|
+
def world
|
110
|
+
Rspec::Core.world
|
111
|
+
end
|
112
|
+
|
108
113
|
def superclass_metadata
|
109
114
|
@superclass_metadata ||= { :example_group => {} }
|
110
115
|
end
|
data/lib/rspec/core/world.rb
CHANGED
@@ -8,7 +8,7 @@ module Rspec
|
|
8
8
|
@example_groups = []
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def inclusion_filter
|
12
12
|
Rspec.configuration.filter
|
13
13
|
end
|
14
14
|
|
@@ -21,66 +21,68 @@ module Rspec
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def example_groups_to_run
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
@example_groups.each { |b| b.examples_to_run.replace(b.examples) }
|
24
|
+
@example_groups_to_run ||= begin
|
25
|
+
if inclusion_filter || exclusion_filter
|
26
|
+
if Rspec.configuration.run_all_when_everything_filtered? && filtered_example_groups.empty?
|
27
|
+
Rspec.configuration.puts "No examples were matched by #{inclusion_filter.inspect}, running all"
|
28
|
+
all_example_groups
|
29
|
+
else
|
30
|
+
Rspec.configuration.puts "Run filtered using #{inclusion_filter.inspect}"
|
31
|
+
filtered_example_groups
|
32
|
+
end
|
34
33
|
else
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
@example_groups.each { |b| b.examples_to_run.replace(b.examples) }
|
40
|
-
end
|
34
|
+
all_example_groups
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
41
38
|
|
42
|
-
|
39
|
+
def all_example_groups
|
40
|
+
@example_groups.each { |g| g.examples_to_run.replace(g.examples) }
|
43
41
|
end
|
44
42
|
|
45
43
|
def total_examples_to_run
|
46
|
-
@total_examples_to_run ||= example_groups_to_run.inject(0) { |sum,
|
44
|
+
@total_examples_to_run ||= example_groups_to_run.inject(0) { |sum, g| sum += g.examples_to_run.size }
|
47
45
|
end
|
48
46
|
|
49
|
-
def
|
50
|
-
example_groups.
|
47
|
+
def filtered_example_groups
|
48
|
+
@filtered_example_groups ||= example_groups.select do |example_group|
|
51
49
|
examples = example_group.examples
|
52
50
|
examples = apply_exclusion_filters(examples, exclusion_filter) if exclusion_filter
|
53
|
-
examples = apply_inclusion_filters(examples,
|
51
|
+
examples = apply_inclusion_filters(examples, inclusion_filter) if inclusion_filter
|
54
52
|
examples.uniq!
|
55
53
|
example_group.examples_to_run.replace(examples)
|
56
|
-
|
57
|
-
|
58
|
-
else
|
59
|
-
list_of_example_groups << example_group
|
60
|
-
end
|
61
|
-
end.compact
|
54
|
+
!examples.empty?
|
55
|
+
end
|
62
56
|
end
|
63
57
|
|
64
|
-
def apply_inclusion_filters(
|
65
|
-
|
58
|
+
def apply_inclusion_filters(examples, conditions={})
|
59
|
+
examples.select &all_apply?(conditions)
|
66
60
|
end
|
67
61
|
|
68
|
-
|
69
|
-
find(collection, :negative, conditions)
|
70
|
-
end
|
62
|
+
alias_method :find, :apply_inclusion_filters
|
71
63
|
|
72
|
-
def
|
73
|
-
|
64
|
+
def apply_exclusion_filters(examples, conditions={})
|
65
|
+
examples.reject &all_apply?(conditions)
|
66
|
+
end
|
74
67
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
item.metadata.apply_condition(filter_on, filter)
|
79
|
-
end
|
80
|
-
negative ? !result : result
|
68
|
+
def preceding_example_or_group_line(filter_line)
|
69
|
+
declaration_line_numbers.inject(nil) do |highest_prior_declaration_line, line|
|
70
|
+
line <= filter_line ? line : highest_prior_declaration_line
|
81
71
|
end
|
82
72
|
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def all_apply?(conditions)
|
77
|
+
lambda {|example| example.metadata.all_apply?(conditions)}
|
78
|
+
end
|
83
79
|
|
80
|
+
def declaration_line_numbers
|
81
|
+
@line_numbers ||= example_groups.inject([]) do |lines, g|
|
82
|
+
lines + g.declaration_line_numbers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
84
86
|
end
|
85
87
|
end
|
86
88
|
end
|
data/rspec-core.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-core}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Chad Humphries", "David Chelimsky"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-17}
|
13
13
|
s.description = %q{Rspec runner and example group classes}
|
14
14
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
15
|
s.executables = ["rspec", "spec"]
|
@@ -166,7 +166,7 @@ Gem::Specification.new do |s|
|
|
166
166
|
s.homepage = %q{http://github.com/rspec/core}
|
167
167
|
s.post_install_message = %q{**************************************************
|
168
168
|
|
169
|
-
Thank you for installing rspec-core-2.0.0.beta.
|
169
|
+
Thank you for installing rspec-core-2.0.0.beta.7
|
170
170
|
|
171
171
|
This is beta software. If you are looking
|
172
172
|
for a supported production release, please
|
@@ -178,7 +178,7 @@ Gem::Specification.new do |s|
|
|
178
178
|
s.require_paths = ["lib"]
|
179
179
|
s.rubyforge_project = %q{rspec}
|
180
180
|
s.rubygems_version = %q{1.3.6}
|
181
|
-
s.summary = %q{rspec-core-2.0.0.beta.
|
181
|
+
s.summary = %q{rspec-core-2.0.0.beta.7}
|
182
182
|
s.test_files = [
|
183
183
|
"spec/autotest/failed_results_re_spec.rb",
|
184
184
|
"spec/autotest/rspec_spec.rb",
|
@@ -216,19 +216,19 @@ Gem::Specification.new do |s|
|
|
216
216
|
s.specification_version = 3
|
217
217
|
|
218
218
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
219
|
-
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
220
|
-
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
219
|
+
s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.7"])
|
220
|
+
s.add_development_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.7"])
|
221
221
|
s.add_development_dependency(%q<cucumber>, [">= 0.5.3"])
|
222
222
|
s.add_development_dependency(%q<autotest>, [">= 4.2.9"])
|
223
223
|
else
|
224
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
225
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
224
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.7"])
|
225
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.7"])
|
226
226
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
227
227
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
228
228
|
end
|
229
229
|
else
|
230
|
-
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.
|
231
|
-
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.
|
230
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.beta.7"])
|
231
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.0.0.beta.7"])
|
232
232
|
s.add_dependency(%q<cucumber>, [">= 0.5.3"])
|
233
233
|
s.add_dependency(%q<autotest>, [">= 4.2.9"])
|
234
234
|
end
|
@@ -339,6 +339,25 @@ module Rspec::Core
|
|
339
339
|
end
|
340
340
|
end
|
341
341
|
|
342
|
+
describe "#let!" do
|
343
|
+
let!(:creator) do
|
344
|
+
class Creator
|
345
|
+
@count = 0
|
346
|
+
def self.count
|
347
|
+
@count += 1
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
it "evaluates the value non-lazily" do
|
353
|
+
lambda { Creator.count }.should_not raise_error
|
354
|
+
end
|
355
|
+
|
356
|
+
it "does not interfere between tests" do
|
357
|
+
Creator.count.should == 1
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
342
361
|
describe "#around" do
|
343
362
|
|
344
363
|
around(:each) do |example|
|
@@ -99,7 +99,7 @@ module Rspec
|
|
99
99
|
end
|
100
100
|
|
101
101
|
describe "line number" do
|
102
|
-
it "finds the line number with the first spec file " do
|
102
|
+
it "finds the line number with the first spec file in the backtrace" do
|
103
103
|
m = Metadata.new
|
104
104
|
m.process(:caller => [
|
105
105
|
"foo",
|
@@ -158,6 +158,13 @@ module Rspec
|
|
158
158
|
it "merges arbitrary options" do
|
159
159
|
mfe[:arbitrary].should == :options
|
160
160
|
end
|
161
|
+
|
162
|
+
it "points :example_group to the same hash object" do
|
163
|
+
a = metadata.for_example("foo", {})[:example_group]
|
164
|
+
b = metadata.for_example("bar", {})[:example_group]
|
165
|
+
a[:description] = "new description"
|
166
|
+
b[:description].should == "new description"
|
167
|
+
end
|
161
168
|
end
|
162
169
|
|
163
170
|
describe "apply_condition" do
|
@@ -165,14 +172,37 @@ module Rspec
|
|
165
172
|
let(:group_line_number) { __LINE__ -1 }
|
166
173
|
let(:example_metadata) { group_metadata.for_example('example', :caller => ["foo_spec.rb:#{__LINE__}"]) }
|
167
174
|
let(:example_line_number) { __LINE__ -1 }
|
168
|
-
|
169
|
-
|
175
|
+
let(:next_example_metadata) {group_metadata.for_example('next_example',
|
176
|
+
:caller => ["foo_spec.rb:#{example_line_number + 2}"])}
|
177
|
+
let(:world) { Rspec::Core.world }
|
178
|
+
|
179
|
+
it "matches the group when the line_number is the example group line number" do
|
180
|
+
world.should_receive(:preceding_example_or_group_line).and_return(group_line_number)
|
181
|
+
# this call doesn't really make sense since apply_condition is only called
|
182
|
+
# for example metadata not group metadata
|
170
183
|
group_metadata.apply_condition(:line_number, group_line_number).should be_true
|
171
184
|
end
|
172
185
|
|
173
|
-
it "matches when the line_number
|
186
|
+
it "matches the example when the line_number is the parent example group line number" do
|
187
|
+
world.should_receive(:preceding_example_or_group_line).and_return(group_line_number)
|
188
|
+
example_metadata.apply_condition(:line_number, group_line_number).should be_true
|
189
|
+
end
|
190
|
+
|
191
|
+
it "matches the example when the line_number is the example line number" do
|
192
|
+
world.should_receive(:preceding_example_or_group_line).and_return(example_line_number)
|
174
193
|
example_metadata.apply_condition(:line_number, example_line_number).should be_true
|
175
194
|
end
|
195
|
+
|
196
|
+
it "matches when the line number is between this example and the next" do
|
197
|
+
world.should_receive(:preceding_example_or_group_line).and_return(example_line_number)
|
198
|
+
example_metadata.apply_condition(:line_number, example_line_number + 1).should be_true
|
199
|
+
end
|
200
|
+
|
201
|
+
it "does not match when the line number matches the next example" do
|
202
|
+
world.should_receive(:preceding_example_or_group_line).and_return(example_line_number + 2)
|
203
|
+
example_metadata.apply_condition(:line_number, example_line_number + 2).should be_false
|
204
|
+
end
|
205
|
+
|
176
206
|
end
|
177
207
|
|
178
208
|
end
|
@@ -131,13 +131,52 @@ module Rspec::Core
|
|
131
131
|
Rspec::Core.world.stub(:exclusion_filter).and_return({ :awesome => false })
|
132
132
|
Rspec::Core.world.stub(:filter).and_return({ :color => :red })
|
133
133
|
Rspec::Core.world.stub(:example_groups).and_return([@group1])
|
134
|
-
filtered_example_groups = @world.
|
134
|
+
filtered_example_groups = @world.filtered_example_groups
|
135
135
|
filtered_example_groups.should == [@group1]
|
136
136
|
@group1.examples_to_run.should == @group1.examples[0..1]
|
137
137
|
end
|
138
138
|
|
139
139
|
end
|
140
140
|
|
141
|
+
describe "preceding_example_or_group_line" do
|
142
|
+
before(:each) do
|
143
|
+
@group1_line = 10
|
144
|
+
@group2_line = 20
|
145
|
+
@group2_example1_line = 30
|
146
|
+
@group2_example2_line = 40
|
147
|
+
|
148
|
+
@group1 = Rspec::Core::ExampleGroup.describe(Bar, "group-1") { }
|
149
|
+
@group2 = Rspec::Core::ExampleGroup.describe(Bar, "group-2") do
|
150
|
+
it('example 1') {}
|
151
|
+
it("example 2") {}
|
152
|
+
end
|
153
|
+
@group1.metadata[:example_group][:line_number] = @group1_line
|
154
|
+
@group2.metadata[:example_group][:line_number] = @group2_line
|
155
|
+
@group2.examples[0].metadata[:line_number] = @group2_example1_line
|
156
|
+
@group2.examples[1].metadata[:line_number] = @group2_example2_line
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should return nil if no example or group precedes the line" do
|
160
|
+
@world.preceding_example_or_group_line(@group1_line-1).should == nil
|
161
|
+
end
|
162
|
+
|
163
|
+
it "should return the argument line number if a group starts on that line" do
|
164
|
+
@world.preceding_example_or_group_line(@group1_line).should == @group1_line
|
165
|
+
end
|
166
|
+
|
167
|
+
it "should return the argument line number if an example starts on that line" do
|
168
|
+
@world.preceding_example_or_group_line(@group2_example1_line).should == @group2_example1_line
|
169
|
+
end
|
170
|
+
|
171
|
+
it "should return line number of a group that immediately precedes the argument line" do
|
172
|
+
@world.preceding_example_or_group_line(@group2_line+1).should == @group2_line
|
173
|
+
end
|
174
|
+
|
175
|
+
it "should return line number of an example that immediately precedes the argument line" do
|
176
|
+
@world.preceding_example_or_group_line(@group2_example1_line+1).should == @group2_example1_line
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
141
180
|
end
|
142
181
|
|
143
182
|
end
|
metadata
CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
|
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- beta
|
10
|
-
-
|
11
|
-
version: 2.0.0.beta.
|
10
|
+
- 7
|
11
|
+
version: 2.0.0.beta.7
|
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-04-
|
20
|
+
date: 2010-04-17 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -32,8 +32,8 @@ dependencies:
|
|
32
32
|
- 0
|
33
33
|
- 0
|
34
34
|
- beta
|
35
|
-
-
|
36
|
-
version: 2.0.0.beta.
|
35
|
+
- 7
|
36
|
+
version: 2.0.0.beta.7
|
37
37
|
type: :development
|
38
38
|
version_requirements: *id001
|
39
39
|
- !ruby/object:Gem::Dependency
|
@@ -48,8 +48,8 @@ dependencies:
|
|
48
48
|
- 0
|
49
49
|
- 0
|
50
50
|
- beta
|
51
|
-
-
|
52
|
-
version: 2.0.0.beta.
|
51
|
+
- 7
|
52
|
+
version: 2.0.0.beta.7
|
53
53
|
type: :development
|
54
54
|
version_requirements: *id002
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -242,7 +242,7 @@ licenses: []
|
|
242
242
|
post_install_message: |
|
243
243
|
**************************************************
|
244
244
|
|
245
|
-
Thank you for installing rspec-core-2.0.0.beta.
|
245
|
+
Thank you for installing rspec-core-2.0.0.beta.7
|
246
246
|
|
247
247
|
This is beta software. If you are looking
|
248
248
|
for a supported production release, please
|
@@ -276,7 +276,7 @@ rubyforge_project: rspec
|
|
276
276
|
rubygems_version: 1.3.6
|
277
277
|
signing_key:
|
278
278
|
specification_version: 3
|
279
|
-
summary: rspec-core-2.0.0.beta.
|
279
|
+
summary: rspec-core-2.0.0.beta.7
|
280
280
|
test_files:
|
281
281
|
- spec/autotest/failed_results_re_spec.rb
|
282
282
|
- spec/autotest/rspec_spec.rb
|