rspec-core 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +9 -4
- data/Guardfile +3 -3
- data/README.md +1 -1
- data/features/.nav +7 -2
- data/features/{README.markdown → Autotest.md} +17 -20
- data/features/Changelog.md +57 -2
- data/features/README.md +17 -0
- data/features/Upgrade.md +8 -66
- data/features/command_line/configure.feature +2 -2
- data/features/command_line/example_name_option.feature +10 -10
- data/features/command_line/exit_status.feature +4 -4
- data/features/command_line/line_number_appended_to_path.feature +11 -11
- data/features/command_line/line_number_option.feature +9 -9
- data/features/command_line/tag.feature +9 -9
- data/features/configuration/custom_settings.feature +3 -3
- data/features/configuration/fail_fast.feature +3 -3
- data/features/configuration/read_options_from_file.feature +4 -4
- data/features/example_groups/shared_example_group.feature +4 -4
- data/features/expectation_framework_integration/configure_expectation_framework.feature +8 -9
- data/features/filtering/exclusion_filters.feature +1 -1
- data/features/filtering/run_all_when_everything_filtered.feature +1 -1
- data/features/formatters/custom_formatter.feature +17 -13
- data/features/helper_methods/arbitrary_methods.feature +40 -0
- data/features/helper_methods/let.feature +50 -0
- data/features/hooks/before_and_after_hooks.feature +10 -10
- data/features/hooks/filtering.feature +37 -20
- data/features/metadata/described_class.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +1 -1
- data/features/mock_framework_integration/use_mocha.feature +1 -1
- data/features/mock_framework_integration/use_rr.feature +1 -1
- data/features/mock_framework_integration/use_rspec.feature +1 -1
- data/features/spec_files/arbitrary_file_suffix.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +1 -1
- data/features/subject/attribute_of_subject.feature +2 -2
- data/features/subject/explicit_subject.feature +5 -5
- data/features/subject/implicit_receiver.feature +2 -2
- data/features/subject/implicit_subject.feature +2 -2
- data/lib/autotest/rspec2.rb +63 -13
- data/lib/rspec/core/configuration.rb +0 -1
- data/lib/rspec/core/configuration_options.rb +15 -12
- data/lib/rspec/core/example.rb +14 -6
- data/lib/rspec/core/example_group.rb +5 -4
- data/lib/rspec/core/formatters/base_formatter.rb +1 -1
- data/lib/rspec/core/formatters/documentation_formatter.rb +1 -1
- data/lib/rspec/core/formatters/html_formatter.rb +131 -32
- data/lib/rspec/core/formatters/snippet_extractor.rb +1 -1
- data/lib/rspec/core/hooks.rb +16 -1
- data/lib/rspec/core/option_parser.rb +6 -6
- data/lib/rspec/core/rake_task.rb +1 -1
- data/lib/rspec/core/subject.rb +7 -7
- data/lib/rspec/core/version.rb +1 -1
- data/rspec-core.gemspec +0 -12
- data/script/FullBuildRakeFile +63 -0
- data/script/cucumber +1 -0
- data/script/full_build +1 -0
- data/script/spec +1 -0
- data/spec/autotest/failed_results_re_spec.rb +22 -5
- data/spec/autotest/rspec_spec.rb +132 -16
- data/spec/rspec/core/configuration_options_spec.rb +38 -6
- data/spec/rspec/core/example_group_spec.rb +15 -64
- data/spec/rspec/core/formatters/base_formatter_spec.rb +23 -0
- data/spec/rspec/core/formatters/html_formatted-1.8.6.html +150 -48
- data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +151 -49
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +150 -48
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +150 -48
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +150 -48
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +150 -48
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +151 -49
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +150 -48
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +150 -48
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +150 -48
- data/spec/rspec/core/hooks_filtering_spec.rb +49 -0
- data/spec/rspec/core/rake_task_spec.rb +3 -3
- data/spec/rspec/core/subject_spec.rb +81 -0
- metadata +20 -22
- data/History.markdown +0 -186
- data/Upgrade.markdown +0 -345
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -14,7 +14,7 @@ end
|
|
14
14
|
gem "rake", "0.8.7"
|
15
15
|
gem "cucumber", "0.9.4"
|
16
16
|
gem "aruba", "0.2.2"
|
17
|
-
gem "rcov", "0.9.9"
|
17
|
+
gem "rcov", "0.9.9", :platforms => :mri
|
18
18
|
gem "relish", "0.2.0"
|
19
19
|
gem "guard-rspec", "0.1.9"
|
20
20
|
gem "growl", "1.0.3"
|
@@ -26,10 +26,15 @@ if RUBY_PLATFORM =~ /darwin/
|
|
26
26
|
gem "autotest-growl", "~> 0.2.9"
|
27
27
|
end
|
28
28
|
|
29
|
-
gem "ruby-debug", :platforms => :
|
30
|
-
gem "ruby-debug19", "~> 0.11.6", :platforms => :
|
29
|
+
gem "ruby-debug", :platforms => :mri_18
|
30
|
+
gem "ruby-debug19", "~> 0.11.6", :platforms => :mri_19
|
31
31
|
|
32
|
-
|
32
|
+
case RUBY_VERSION
|
33
|
+
when '1.9.1'; gem 'ruby-debug-base19', '0.11.23'
|
34
|
+
when '1.9.2'; gem 'ruby-debug-base19', '0.11.24'
|
35
|
+
end
|
36
|
+
|
37
|
+
platforms :mri_18, :mri_19 do
|
33
38
|
gem "rb-fsevent", "~> 0.3.9"
|
34
39
|
gem "ruby-prof", "~> 0.9.2"
|
35
40
|
end
|
data/Guardfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
guard 'rspec', :version => 2 do
|
2
|
-
watch(
|
3
|
-
watch(
|
4
|
-
watch(
|
2
|
+
watch(/^spec\/(.*)_spec.rb/)
|
3
|
+
watch(/^lib\/(.*)\.rb/) { |m| "spec/#{m[1]}_spec.rb" }
|
4
|
+
watch(/^spec\/spec_helper.rb/) { "spec" }
|
5
5
|
end
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ tracker](https://github.com/rspec/rspec-core/issues).
|
|
22
22
|
|
23
23
|
## Upgrading from rspec-1.x
|
24
24
|
|
25
|
-
See [Upgrade.
|
25
|
+
See [features/Upgrade.md](http://github.com/rspec/rspec-core/blob/master/features/Upgrade.md)
|
26
26
|
|
27
27
|
|
28
28
|
This will install the rspec, rspec-core, rspec-expectations and rspec-mocks
|
data/features/.nav
CHANGED
@@ -1,18 +1,23 @@
|
|
1
1
|
- Upgrade.md
|
2
2
|
- Changelog.md
|
3
|
+
- Autotest.md
|
3
4
|
- example_groups:
|
4
5
|
- basic_structure.feature
|
5
6
|
- shared_example_group.feature
|
7
|
+
- pending:
|
8
|
+
- pending_examples.feature
|
6
9
|
- hooks:
|
7
10
|
- before_and_after_hooks.feature
|
8
11
|
- around_hooks.feature
|
9
|
-
-
|
10
|
-
- pending_examples.feature
|
12
|
+
- filtering.feature
|
11
13
|
- subject:
|
12
14
|
- implicit_subject.feature
|
13
15
|
- explicit_subject.feature
|
14
16
|
- attribute_of_subject.feature
|
15
17
|
- implicit_receiver.feature
|
18
|
+
- helper_methods:
|
19
|
+
- let.feature
|
20
|
+
- arbitrary_methods.feature
|
16
21
|
- metadata:
|
17
22
|
- described_class.feature
|
18
23
|
- filtering:
|
@@ -1,15 +1,3 @@
|
|
1
|
-
rspec-core provides the structure for RSpec code examples:
|
2
|
-
|
3
|
-
describe Account do
|
4
|
-
it "has a balance of zero when first opened" do
|
5
|
-
# example code goes here - for more on the
|
6
|
-
# code inside the examples, see rspec-expectations
|
7
|
-
# and rspec-mocks
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
### Autotest integration
|
12
|
-
|
13
1
|
RSpec ships with a specialized subclass of Autotest. You can pass the --style
|
14
2
|
option to the autotest command to tell Autotest to load this subclass:
|
15
3
|
|
@@ -36,12 +24,21 @@ that directory with the following:
|
|
36
24
|
# in ./autotest/discover.rb
|
37
25
|
Autotest.add_discovery {"rspec2"}
|
38
26
|
|
39
|
-
|
27
|
+
NOTE that this approach will not be supported by future versions of ZenTest on
|
28
|
+
Ruby-1.9.
|
29
|
+
|
30
|
+
### `bundle exec`
|
31
|
+
|
32
|
+
By default, RSpec adds `bundle exec` to the command generated by Autotest if
|
33
|
+
there is a `Gemfile` in the project root directory.
|
34
|
+
|
35
|
+
As of rspec-core-2.5, this automatic inclusion of 'bundle exec' is deprecated.
|
36
|
+
If you want to include 'bundle exec', use Autotest's bundler plugin by adding
|
37
|
+
a .autotest file to the project root directory with the following:
|
38
|
+
|
39
|
+
require 'autotest/bundler'
|
40
|
+
|
41
|
+
If you want to skip 'bundle exec', pass `--skip-bundler` to the `autotest`
|
42
|
+
command and it won't include `bundle exec` even if there is a `Gemfile`.
|
40
43
|
|
41
|
-
|
42
|
-
Cucumber features over time, and clarifying existing ones. If you have
|
43
|
-
specific features you'd like to see added, find the existing documentation
|
44
|
-
incomplete or confusing, or, better yet, wish to write a missing Cucumber
|
45
|
-
feature yourself, please [submit an
|
46
|
-
issue](http://github.com/rspec/rspec-core/issues) or a [pull
|
47
|
-
request](http://github.com/rspec/rspec-core).
|
44
|
+
autotest -- --skip-bundler
|
data/features/Changelog.md
CHANGED
@@ -1,4 +1,59 @@
|
|
1
|
-
|
1
|
+
### 2.5.0 / 2011-02-05
|
2
|
+
|
3
|
+
[full changelog](http://github.com/rspec/rspec-core/compare/v2.4.0...v2.5.0)
|
4
|
+
|
5
|
+
* Enhancements
|
6
|
+
* Autotest::Rspec2 parses command line args passed to autotest after '--'
|
7
|
+
* --skip-bundler option for autotest command
|
8
|
+
* Autotest regexp fixes (Jon Rowe)
|
9
|
+
* Add filters to html and textmate formatters (Daniel Quimper)
|
10
|
+
* Explicit passing of block (need for JRuby 1.6) (John Firebaugh)
|
11
|
+
|
12
|
+
* Bug fixes
|
13
|
+
* fix dom IDs in HTML formatter (Brian Faherty)
|
14
|
+
* fix bug with --drb + formatters when not running in drb
|
15
|
+
* include --tag options in drb args (monocle)
|
16
|
+
* fix regression so now SPEC_OPTS take precedence over CLI options again
|
17
|
+
(Roman Chernyatchik)
|
18
|
+
* only call its(:attribute) once (failing example from Brian Dunn)
|
19
|
+
* fix bizarre bug where rspec would hang after String.alias :to_int :to_i
|
20
|
+
(Damian Nurzynski)
|
21
|
+
|
22
|
+
* Deprecations
|
23
|
+
* implicit inclusion of 'bundle exec' when Gemfile present (use autotest's
|
24
|
+
bundler plugin instead)
|
25
|
+
|
26
|
+
### 2.4.0 / 2011-01-02
|
27
|
+
|
28
|
+
[full changelog](http://github.com/rspec/rspec-core/compare/v2.3.1...v2.4.0)
|
29
|
+
|
30
|
+
* Enhancements
|
31
|
+
* start the debugger on -d so the stack trace is visible when it stops
|
32
|
+
(Clifford Heath)
|
33
|
+
* apply hook filtering to examples as well as groups (Myron Marston)
|
34
|
+
* support multiple formatters, each with their own output
|
35
|
+
* show exception classes in failure messages unless they come from RSpec
|
36
|
+
matchers or message expectations
|
37
|
+
* before(:all) { pending } sets all examples to pending
|
38
|
+
|
39
|
+
* Bug fixes
|
40
|
+
* fix bug due to change in behavior of reject in Ruby 1.9.3-dev (Shota Fukumori)
|
41
|
+
* fix bug when running in jruby: be explicit about passing block to super
|
42
|
+
(John Firebaugh)
|
43
|
+
* rake task doesn't choke on paths with quotes (Janmejay Singh)
|
44
|
+
* restore --options option from rspec-1
|
45
|
+
* require 'ostruct' to fix bug with its([key]) (Kim Burgestrand)
|
46
|
+
* --configure option generates .rspec file instead of autotest/discover.rb
|
47
|
+
|
48
|
+
### 2.3.1 / 2010-12-16
|
49
|
+
|
50
|
+
[full changelog](http://github.com/rspec/rspec-core/compare/v2.3.0...v2.3.1)
|
51
|
+
|
52
|
+
* Bug fixes
|
53
|
+
* send debugger warning message to $stdout if RSpec.configuration.error_stream
|
54
|
+
has not been defined yet.
|
55
|
+
* HTML Formatter _finally_ properly displays nested groups (Jarmo Pertman)
|
56
|
+
* eliminate some warnings when running RSpec's own suite (Jarmo Pertman)
|
2
57
|
|
3
58
|
### 2.3.0 / 2010-12-12
|
4
59
|
|
@@ -44,7 +99,7 @@
|
|
44
99
|
* debugger statements _just work_ as long as ruby-debug is installed
|
45
100
|
* otherwise you get warned, but not fired
|
46
101
|
* Expose example.metadata in around hooks
|
47
|
-
* Performance improvments (
|
102
|
+
* Performance improvments (much faster now)
|
48
103
|
|
49
104
|
* Bug fixes
|
50
105
|
* Make sure --fail-fast makes it across drb
|
data/features/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
rspec-core provides the structure for RSpec code examples:
|
2
|
+
|
3
|
+
describe Account do
|
4
|
+
it "has a balance of zero when first opened" do
|
5
|
+
# example code goes here - for more on the
|
6
|
+
# code inside the examples, see rspec-expectations
|
7
|
+
# and rspec-mocks
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
## Issues
|
12
|
+
|
13
|
+
This documentation is [open
|
14
|
+
source](https://github.com/rspec/rspec-core/tree/master/features), and a work
|
15
|
+
in progress. If you find it incomplete or confusing, please [submit an
|
16
|
+
issue](http://github.com/rspec/rspec-core/issues), or, better yet, [a pull
|
17
|
+
request](http://github.com/rspec/rspec-core).
|
data/features/Upgrade.md
CHANGED
@@ -1,59 +1,17 @@
|
|
1
1
|
# rspec-core-2.3
|
2
2
|
|
3
|
-
##
|
4
|
-
|
5
|
-
Add a .rspec file to the project's root directory to tell RSpec to tell
|
6
|
-
Autotest to use RSpec's specialized Autotest class.
|
7
|
-
|
8
|
-
NOTE that rspec-core-2.0, 2.1, and 2.2 required an autotest/discover.rb file in
|
9
|
-
the project's root directory. This worked with some, but not all versions of
|
10
|
-
autotest and/or the autotest command that ships with ZenTest. This new approach
|
11
|
-
will work regardless of which version of autotest/ZenTest you are using.
|
12
|
-
|
13
|
-
## config.expect_with
|
3
|
+
## `config.expect_with`
|
14
4
|
|
15
5
|
Use this to configure RSpec to use rspec/expectations (default),
|
16
|
-
|
6
|
+
stdlib assertions (Test::Unit with Ruby 1.8, MiniTest with Ruby 1.9),
|
7
|
+
or both:
|
17
8
|
|
18
9
|
RSpec.configure do |config|
|
19
10
|
config.expect_with :rspec # => rspec/expectations
|
20
|
-
config.expect_with :stdlib # =>
|
11
|
+
config.expect_with :stdlib # => Test::Unit or MinitTest
|
21
12
|
config.expect_with :rspec, :stdlib # => both
|
22
13
|
end
|
23
14
|
|
24
|
-
# rspec-core-2.2
|
25
|
-
|
26
|
-
## FASTER!
|
27
|
-
|
28
|
-
Made several small optimizations that all add up to a considerable improvement
|
29
|
-
in performance. Using a simple benchmark:
|
30
|
-
|
31
|
-
generate 5000 example groups,
|
32
|
-
each with one example,
|
33
|
-
each with one passing expectation
|
34
|
-
|
35
|
-
Run using ruby-1.9.2 on Mac OS X w/ 3.06 G
|
36
|
-
|
37
|
-
* rspec-2.1
|
38
|
-
* loaded in 0.85 on avg
|
39
|
-
* ran in 2.61 on avg
|
40
|
-
* rspec-2.2
|
41
|
-
* loaded in 0.73 on avg (~15% improvement)
|
42
|
-
* ran in 0.94 on avg (~64% improvement**)
|
43
|
-
|
44
|
-
** this does _not_ mean your suite will be 64% faster, but it does mean that
|
45
|
-
the overhead incurred by RSpec in your suite should be roughly 64% less.
|
46
|
-
|
47
|
-
## Command line
|
48
|
-
|
49
|
-
### --debug/-d is now deprecated
|
50
|
-
|
51
|
-
This command line option is now has no effect (other than a deprecation
|
52
|
-
warning). To use the debugger, just add a `debugger` statement anywhere in your
|
53
|
-
code. As long as you have ruby-debug installed, it will just work. If you
|
54
|
-
don't, then you'll get a friendly warning telling you what's going on, but
|
55
|
-
execution will continue.
|
56
|
-
|
57
15
|
# rspec-core-2.1
|
58
16
|
|
59
17
|
## Command line
|
@@ -205,9 +163,9 @@ passed to `it_should_behave_like`.
|
|
205
163
|
See [features/example\_groups/shared\_example\_group.feature](http://github.com/rspec/rspec-core/blob/master/features/example_groups/shared_example_group.feature) for more information.
|
206
164
|
|
207
165
|
NOTICE: The including example groups no longer have access to any of the
|
208
|
-
methods, hooks, or state defined inside a shared group. This will break
|
209
|
-
that were using shared example groups to extend the behavior of including
|
210
|
-
groups
|
166
|
+
methods, hooks, or state defined inside a shared group. This will break rspec-1
|
167
|
+
specs that were using shared example groups to extend the behavior of including
|
168
|
+
groups.
|
211
169
|
|
212
170
|
# Upgrading from rspec-1.x
|
213
171
|
|
@@ -278,23 +236,7 @@ A few things changed in the Rake task used to run specs:
|
|
278
236
|
|
279
237
|
### autotest
|
280
238
|
|
281
|
-
|
282
|
-
|
283
|
-
rspec --configure autotest
|
284
|
-
|
285
|
-
This adds `./autotest/discover.rb` with:
|
286
|
-
|
287
|
-
Autotest.add_discovery { "rspec2" }
|
288
|
-
|
289
|
-
Now, on the command line just type:
|
290
|
-
|
291
|
-
autotest
|
292
|
-
|
293
|
-
Or, if you're using bundler:
|
294
|
-
|
295
|
-
bundle exec autotest
|
296
|
-
|
297
|
-
The `autospec` command is a thing of the past.
|
239
|
+
`autospec` is dead. Long live `autotest`.
|
298
240
|
|
299
241
|
### RSpec is the new Spec
|
300
242
|
|
@@ -11,7 +11,7 @@ Feature: --configure option
|
|
11
11
|
When I run "rspec --configure autotest"
|
12
12
|
Then the following files should exist:
|
13
13
|
| .rspec |
|
14
|
-
And the
|
14
|
+
And the output should contain ".rspec file did not exist, so it was created."
|
15
15
|
|
16
16
|
Scenario: .rspec file already exists
|
17
17
|
Given a file named ".rspec" with:
|
@@ -19,4 +19,4 @@ Feature: --configure option
|
|
19
19
|
--color
|
20
20
|
"""
|
21
21
|
When I run "rspec --configure autotest"
|
22
|
-
Then the
|
22
|
+
Then the output should contain ".rspec file already exists, so nothing was changed."
|
@@ -47,40 +47,40 @@ Feature: --example option
|
|
47
47
|
|
48
48
|
Scenario: no matches
|
49
49
|
When I run "rspec . --example nothing_like_this"
|
50
|
-
Then the
|
50
|
+
Then the examples should all pass
|
51
51
|
|
52
52
|
Scenario: match on one word
|
53
53
|
When I run "rspec . --example example"
|
54
|
-
Then the
|
54
|
+
Then the examples should all pass
|
55
55
|
|
56
56
|
Scenario: one match in each context
|
57
57
|
When I run "rspec . --example 'first example'"
|
58
|
-
Then the
|
58
|
+
Then the examples should all pass
|
59
59
|
|
60
60
|
Scenario: one match in one file using just the example name
|
61
61
|
When I run "rspec . --example 'first example in first group'"
|
62
|
-
Then the
|
62
|
+
Then the examples should all pass
|
63
63
|
|
64
64
|
Scenario: one match in one file using the example name and the group name
|
65
65
|
When I run "rspec . --example 'first group first example in first group'"
|
66
|
-
Then the
|
66
|
+
Then the examples should all pass
|
67
67
|
|
68
68
|
Scenario: one match in one file using regexp
|
69
69
|
When I run "rspec . --example 'first .* first example'"
|
70
|
-
Then the
|
70
|
+
Then the examples should all pass
|
71
71
|
|
72
72
|
Scenario: all examples in one group
|
73
73
|
When I run "rspec . --example 'first group'"
|
74
|
-
Then the
|
74
|
+
Then the examples should all pass
|
75
75
|
|
76
76
|
Scenario: one match in one file with group name
|
77
77
|
When I run "rspec . --example 'second group first example'"
|
78
|
-
Then the
|
78
|
+
Then the examples should all pass
|
79
79
|
|
80
80
|
Scenario: all examples in one group including examples in nested groups
|
81
81
|
When I run "rspec . --example 'third group'"
|
82
|
-
Then the
|
82
|
+
Then the examples should all pass
|
83
83
|
|
84
84
|
Scenario: Object#method
|
85
85
|
When I run "rspec . --example 'Array#length'"
|
86
|
-
Then the
|
86
|
+
Then the examples should all pass
|
@@ -13,7 +13,7 @@ Feature: exit status
|
|
13
13
|
"""
|
14
14
|
When I run "rspec ok_spec.rb"
|
15
15
|
Then the exit status should be 0
|
16
|
-
And the
|
16
|
+
And the examples should all pass
|
17
17
|
|
18
18
|
Scenario: exit with 1 when one example fails
|
19
19
|
Given a file named "ko_spec.rb" with:
|
@@ -26,7 +26,7 @@ Feature: exit status
|
|
26
26
|
"""
|
27
27
|
When I run "rspec ko_spec.rb"
|
28
28
|
Then the exit status should be 1
|
29
|
-
And the
|
29
|
+
And the output should contain "1 example, 1 failure"
|
30
30
|
|
31
31
|
Scenario: exit with 1 when a nested examples fails
|
32
32
|
Given a file named "nested_ko_spec.rb" with:
|
@@ -41,7 +41,7 @@ Feature: exit status
|
|
41
41
|
"""
|
42
42
|
When I run "rspec nested_ko_spec.rb"
|
43
43
|
Then the exit status should be 1
|
44
|
-
And the
|
44
|
+
And the output should contain "1 example, 1 failure"
|
45
45
|
|
46
46
|
Scenario: exit with 0 when no examples are run
|
47
47
|
Given a file named "a_no_examples_spec.rb" with:
|
@@ -49,4 +49,4 @@ Feature: exit status
|
|
49
49
|
"""
|
50
50
|
When I run "rspec a_no_examples_spec.rb"
|
51
51
|
Then the exit status should be 0
|
52
|
-
And the
|
52
|
+
And the output should contain "0 examples"
|
@@ -30,77 +30,77 @@ Feature: line number appended to file path
|
|
30
30
|
|
31
31
|
Scenario: nested groups - outer group on declaration line
|
32
32
|
When I run "rspec example_spec.rb:1 --format doc"
|
33
|
-
Then the
|
33
|
+
Then the examples should all pass
|
34
34
|
And the output should contain "second example in outer group"
|
35
35
|
And the output should contain "first example in outer group"
|
36
36
|
And the output should contain "example in nested group"
|
37
37
|
|
38
38
|
Scenario: nested groups - outer group inside block before example
|
39
39
|
When I run "rspec example_spec.rb:2 --format doc"
|
40
|
-
Then the
|
40
|
+
Then the examples should all pass
|
41
41
|
And the output should contain "second example in outer group"
|
42
42
|
And the output should contain "first example in outer group"
|
43
43
|
And the output should contain "example in nested group"
|
44
44
|
|
45
45
|
Scenario: nested groups - inner group on declaration line
|
46
46
|
When I run "rspec example_spec.rb:11 --format doc"
|
47
|
-
Then the
|
47
|
+
Then the examples should all pass
|
48
48
|
And the output should contain "example in nested group"
|
49
49
|
And the output should not contain "second example in outer group"
|
50
50
|
And the output should not contain "first example in outer group"
|
51
51
|
|
52
52
|
Scenario: nested groups - inner group inside block before example
|
53
53
|
When I run "rspec example_spec.rb:12 --format doc"
|
54
|
-
Then the
|
54
|
+
Then the examples should all pass
|
55
55
|
And the output should contain "example in nested group"
|
56
56
|
And the output should not contain "second example in outer group"
|
57
57
|
And the output should not contain "first example in outer group"
|
58
58
|
|
59
59
|
Scenario: two examples - first example on declaration line
|
60
60
|
When I run "rspec example_spec.rb:3 --format doc"
|
61
|
-
Then the
|
61
|
+
Then the examples should all pass
|
62
62
|
And the output should contain "first example in outer group"
|
63
63
|
But the output should not contain "second example in outer group"
|
64
64
|
And the output should not contain "example in nested group"
|
65
65
|
|
66
66
|
Scenario: two examples - first example inside block
|
67
67
|
When I run "rspec example_spec.rb:4 --format doc"
|
68
|
-
Then the
|
68
|
+
Then the examples should all pass
|
69
69
|
And the output should contain "first example in outer group"
|
70
70
|
But the output should not contain "second example in outer group"
|
71
71
|
And the output should not contain "example in nested group"
|
72
72
|
|
73
73
|
Scenario: two examples - first example on end
|
74
74
|
When I run "rspec example_spec.rb:5 --format doc"
|
75
|
-
Then the
|
75
|
+
Then the examples should all pass
|
76
76
|
And the output should contain "first example in outer group"
|
77
77
|
But the output should not contain "second example in outer group"
|
78
78
|
And the output should not contain "example in nested group"
|
79
79
|
|
80
80
|
Scenario: two examples - first example after end but before next example
|
81
81
|
When I run "rspec example_spec.rb:6 --format doc"
|
82
|
-
Then the
|
82
|
+
Then the examples should all pass
|
83
83
|
And the output should contain "first example in outer group"
|
84
84
|
But the output should not contain "second example in outer group"
|
85
85
|
And the output should not contain "example in nested group"
|
86
86
|
|
87
87
|
Scenario: two examples - second example on declaration line
|
88
88
|
When I run "rspec example_spec.rb:7 --format doc"
|
89
|
-
Then the
|
89
|
+
Then the examples should all pass
|
90
90
|
And the output should contain "second example in outer group"
|
91
91
|
But the output should not contain "first example in outer group"
|
92
92
|
And the output should not contain "example in nested group"
|
93
93
|
|
94
94
|
Scenario: two examples - second example inside block
|
95
95
|
When I run "rspec example_spec.rb:7 --format doc"
|
96
|
-
Then the
|
96
|
+
Then the examples should all pass
|
97
97
|
And the output should contain "second example in outer group"
|
98
98
|
But the output should not contain "first example in outer group"
|
99
99
|
And the output should not contain "example in nested group"
|
100
100
|
|
101
101
|
Scenario: two examples - second example on end
|
102
102
|
When I run "rspec example_spec.rb:7 --format doc"
|
103
|
-
Then the
|
103
|
+
Then the examples should all pass
|
104
104
|
And the output should contain "second example in outer group"
|
105
105
|
But the output should not contain "first example in outer group"
|
106
106
|
And the output should not contain "example in nested group"
|