rspec-core 2.5.2 → 2.6.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +10 -13
- data/README.md +4 -1
- data/Rakefile +29 -12
- data/cucumber.yml +1 -1
- data/features/.nav +10 -4
- data/features/Autotest.md +31 -7
- data/features/Changelog.md +36 -6
- 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/format_option.feature +4 -4
- data/features/command_line/line_number_appended_to_path.feature +11 -11
- data/features/command_line/line_number_option.feature +2 -2
- data/features/command_line/rake_task.feature +3 -3
- data/features/command_line/tag.feature +26 -10
- data/features/configuration/alias_example_to.feature +48 -0
- 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/basic_structure.feature +11 -15
- data/features/example_groups/shared_context.feature +74 -0
- data/features/example_groups/shared_example_group.feature +21 -17
- data/features/expectation_framework_integration/configure_expectation_framework.feature +15 -4
- data/features/filtering/exclusion_filters.feature +28 -4
- data/features/filtering/{implicit_filters.feature → if_and_unless.feature} +9 -7
- data/features/filtering/inclusion_filters.feature +26 -3
- data/features/filtering/run_all_when_everything_filtered.feature +1 -1
- data/features/formatters/custom_formatter.feature +1 -1
- data/features/formatters/text_formatter.feature +45 -0
- data/features/helper_methods/arbitrary_methods.feature +2 -2
- data/features/helper_methods/let.feature +2 -2
- data/features/helper_methods/modules.feature +149 -0
- data/features/hooks/around_hooks.feature +11 -11
- data/features/hooks/before_and_after_hooks.feature +15 -19
- data/features/hooks/filtering.feature +160 -124
- data/features/metadata/current_example.feature +17 -0
- data/features/metadata/described_class.feature +2 -2
- data/features/metadata/user_defined.feature +111 -0
- data/features/mock_framework_integration/use_any_framework.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +83 -10
- data/features/mock_framework_integration/use_mocha.feature +84 -10
- data/features/mock_framework_integration/use_rr.feature +85 -10
- data/features/mock_framework_integration/use_rspec.feature +84 -10
- data/features/pending/pending_examples.feature +8 -8
- data/features/spec_files/arbitrary_file_suffix.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +11 -1
- data/features/subject/attribute_of_subject.feature +24 -4
- 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/features/support/env.rb +6 -1
- data/lib/rspec/core.rb +22 -0
- data/lib/rspec/core/backward_compatibility.rb +12 -2
- data/lib/rspec/core/command_line.rb +1 -4
- data/lib/rspec/core/configuration.rb +25 -17
- data/lib/rspec/core/configuration_options.rb +6 -23
- data/lib/rspec/core/drb_command_line.rb +5 -11
- data/lib/rspec/core/example.rb +29 -21
- data/lib/rspec/core/example_group.rb +36 -4
- data/lib/rspec/core/formatters/base_formatter.rb +6 -0
- data/lib/rspec/core/formatters/base_text_formatter.rb +1 -1
- data/lib/rspec/core/formatters/helpers.rb +0 -4
- data/lib/rspec/core/hooks.rb +14 -4
- data/lib/rspec/core/metadata.rb +1 -1
- data/lib/rspec/core/metadata_hash_builder.rb +93 -0
- data/lib/rspec/core/mocking/with_flexmock.rb +2 -0
- data/lib/rspec/core/mocking/with_mocha.rb +2 -0
- data/lib/rspec/core/mocking/with_rr.rb +2 -0
- data/lib/rspec/core/mocking/with_rspec.rb +3 -1
- data/lib/rspec/core/option_parser.rb +5 -2
- data/lib/rspec/core/pending.rb +10 -3
- data/lib/rspec/core/reporter.rb +2 -2
- data/lib/rspec/core/runner.rb +7 -1
- data/lib/rspec/core/shared_example_group.rb +18 -4
- data/lib/rspec/core/subject.rb +4 -6
- data/lib/rspec/core/version.rb +1 -1
- data/lib/rspec/core/world.rb +16 -4
- data/rspec-core.gemspec +4 -3
- data/spec.txt +1126 -0
- data/spec/autotest/failed_results_re_spec.rb +2 -2
- data/spec/rspec/core/command_line_spec.rb +0 -2
- data/spec/rspec/core/configuration_spec.rb +84 -1
- data/spec/rspec/core/deprecations_spec.rb +21 -0
- data/spec/rspec/core/drb_command_line_spec.rb +3 -11
- data/spec/rspec/core/example_group_spec.rb +213 -56
- data/spec/rspec/core/example_spec.rb +110 -0
- data/spec/rspec/core/formatters/base_formatter_spec.rb +23 -2
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +9 -0
- data/spec/rspec/core/formatters/helpers_spec.rb +1 -1
- data/spec/rspec/core/formatters/html_formatted-1.8.6.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +8 -10
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +5 -5
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -1
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +8 -10
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +5 -5
- data/spec/rspec/core/hooks_spec.rb +86 -0
- data/spec/rspec/core/metadata_spec.rb +7 -7
- data/spec/rspec/core/option_parser_spec.rb +8 -0
- data/spec/rspec/core/pending_example_spec.rb +12 -51
- data/spec/rspec/core/reporter_spec.rb +19 -3
- data/spec/rspec/core/resources/formatter_specs.rb +7 -1
- data/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/spec/rspec/core/runner_spec.rb +35 -10
- data/spec/rspec/core/shared_example_group_spec.rb +57 -21
- data/spec/rspec/core/subject_spec.rb +32 -11
- data/spec/rspec/core/world_spec.rb +38 -15
- data/spec/rspec/core_spec.rb +28 -0
- data/spec/spec_helper.rb +22 -2
- data/spec/support/matchers.rb +44 -13
- data/spec/support/shared_example_groups.rb +41 -0
- metadata +39 -16
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -6,14 +6,14 @@ source "http://rubygems.org"
|
|
6
6
|
if File.exist?(library_path)
|
7
7
|
gem lib, :path => library_path
|
8
8
|
else
|
9
|
-
gem lib
|
9
|
+
gem lib, :git => "git://github.com/rspec/#{lib}.git"
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
### dev dependencies
|
14
14
|
gem "rake", "0.8.7"
|
15
|
-
gem "cucumber", "0.
|
16
|
-
gem "aruba", "
|
15
|
+
# gem "cucumber", "~> 0.10.2"
|
16
|
+
# gem "aruba", :git => "git://github.com/aslakhellesoy/aruba"
|
17
17
|
gem "rcov", "0.9.9", :platforms => :mri
|
18
18
|
gem "relish", "0.2.0"
|
19
19
|
gem "guard-rspec", "0.1.9"
|
@@ -21,17 +21,14 @@ gem "growl", "1.0.3"
|
|
21
21
|
gem "ZenTest", "~> 4.4.2"
|
22
22
|
gem "nokogiri", "1.4.4"
|
23
23
|
|
24
|
-
|
25
|
-
gem
|
26
|
-
gem "autotest-growl", "~> 0.2.9"
|
24
|
+
platforms :mri_18 do
|
25
|
+
gem 'ruby-debug'
|
27
26
|
end
|
28
27
|
|
29
|
-
|
30
|
-
gem
|
31
|
-
|
32
|
-
|
33
|
-
when '1.9.1'; gem 'ruby-debug-base19', '0.11.23'
|
34
|
-
when '1.9.2'; gem 'ruby-debug-base19', '0.11.24'
|
28
|
+
platforms :mri_19 do
|
29
|
+
gem 'linecache19', '0.5.11' # 0.5.12 cannot install on 1.9.1, and 0.5.11 appears to work with both 1.9.1 & 1.9.2
|
30
|
+
gem 'ruby-debug19'
|
31
|
+
gem 'ruby-debug-base19', RUBY_VERSION == '1.9.1' ? '0.11.23' : '~> 0.11.24'
|
35
32
|
end
|
36
33
|
|
37
34
|
platforms :mri_18, :mri_19 do
|
@@ -46,7 +43,7 @@ end
|
|
46
43
|
### rspec-core only
|
47
44
|
gem "mocha", "~> 0.9.10"
|
48
45
|
gem "rr", "~> 1.0.2"
|
49
|
-
gem "flexmock", "
|
46
|
+
gem "flexmock", "0.8.8"
|
50
47
|
|
51
48
|
### optional runtime deps
|
52
49
|
gem "syntax", "1.0.0"
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# RSpec Core
|
2
2
|
|
3
|
-
|
3
|
+
RSpec Core provides the structure for writing executable examples of how your
|
4
|
+
code should behave.
|
5
|
+
|
6
|
+
[![build status](http://travis-ci.org/rspec/rspec-core.png)](http://travis-ci.org/rspec/rspec-core)
|
4
7
|
|
5
8
|
## Documentation
|
6
9
|
|
data/Rakefile
CHANGED
@@ -8,13 +8,25 @@ require "yaml"
|
|
8
8
|
require "rake/rdoctask"
|
9
9
|
require "rspec/core/rake_task"
|
10
10
|
require "rspec/core/version"
|
11
|
-
require "cucumber/rake/task"
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
cucumber_loaded = false
|
13
|
+
begin
|
14
|
+
require "cucumber/rake/task"
|
15
|
+
|
16
|
+
Cucumber::Rake::Task.new(:cucumber)
|
17
|
+
|
18
|
+
class Cucumber::Rake::Task::ForkedCucumberRunner
|
19
|
+
# When cucumber shells out, we still need it to run in the context of our
|
20
|
+
# bundle.
|
21
|
+
def run
|
22
|
+
sh "bundle exec #{RUBY} " + args.join(" ")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
cucumber_loaded = true
|
26
|
+
rescue LoadError => e
|
27
|
+
puts "unable to load cucumber, some tasks unavailable"
|
28
|
+
task :cucumber do
|
29
|
+
# no-op
|
18
30
|
end
|
19
31
|
end
|
20
32
|
|
@@ -25,7 +37,6 @@ RSpec::Core::RakeTask.new(:spec) do |t|
|
|
25
37
|
t.verbose = false
|
26
38
|
end
|
27
39
|
|
28
|
-
Cucumber::Rake::Task.new(:cucumber)
|
29
40
|
|
30
41
|
namespace :rcov do
|
31
42
|
task :cleanup do
|
@@ -38,11 +49,17 @@ namespace :rcov do
|
|
38
49
|
t.rcov_opts << %[--no-html --aggregate coverage.data]
|
39
50
|
end
|
40
51
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
if cucumber_loaded
|
53
|
+
Cucumber::Rake::Task.new :cucumber do |t|
|
54
|
+
t.cucumber_opts = %w{--format progress}
|
55
|
+
t.rcov = true
|
56
|
+
t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
|
57
|
+
t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
|
58
|
+
end
|
59
|
+
else
|
60
|
+
task :cucumber do
|
61
|
+
# no-op
|
62
|
+
end
|
46
63
|
end
|
47
64
|
|
48
65
|
end
|
data/cucumber.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
default: --require features --strict --format progress --tags ~@wip features
|
1
|
+
default: --require features --strict --format progress --tags ~@wip<%= RUBY_PLATFORM == 'java' ? ' --tags ~@no-jruby' : '' %> features
|
2
2
|
wip: --require features --tags @wip:3 --wip features
|
data/features/.nav
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
- example_groups:
|
5
5
|
- basic_structure.feature
|
6
6
|
- shared_example_group.feature
|
7
|
+
- shared_context.feature
|
7
8
|
- pending:
|
8
9
|
- pending_examples.feature
|
9
10
|
- hooks:
|
@@ -18,25 +19,30 @@
|
|
18
19
|
- helper_methods:
|
19
20
|
- let.feature
|
20
21
|
- arbitrary_methods.feature
|
22
|
+
- modules.feature
|
21
23
|
- metadata:
|
24
|
+
- current_example.feature
|
22
25
|
- described_class.feature
|
26
|
+
- user_defined.feature
|
23
27
|
- filtering:
|
24
28
|
- inclusion_filters.feature
|
25
29
|
- exclusion_filters.feature
|
26
|
-
-
|
30
|
+
- if_and_unless.feature
|
27
31
|
- run_all_when_everything_filtered.feature
|
28
32
|
- command_line:
|
29
33
|
- configure.feature
|
30
34
|
- example_name_option.feature
|
31
|
-
-
|
32
|
-
- line_number_appended_to_path.feature
|
35
|
+
- format_option.feature
|
33
36
|
- line_number_option.feature
|
34
|
-
- rake_task.feature
|
35
37
|
- tag.feature
|
38
|
+
- line_number_appended_to_path.feature
|
39
|
+
- exit_status.feature
|
40
|
+
- rake_task.feature
|
36
41
|
- configuration:
|
37
42
|
- read_options_from_file.feature
|
38
43
|
- fail_fast.feature
|
39
44
|
- custom_settings.feature
|
45
|
+
- alias_example_to.feature
|
40
46
|
- expectation_framework_integration:
|
41
47
|
- configure_expectation_framework.feature
|
42
48
|
- mock_framework_integration:
|
data/features/Autotest.md
CHANGED
@@ -1,14 +1,38 @@
|
|
1
|
-
RSpec ships with a specialized subclass of Autotest. To
|
2
|
-
|
3
|
-
|
1
|
+
RSpec ships with a specialized subclass of Autotest. To use it, just add a
|
2
|
+
`.rspec` file to your project's root directory, and run the `autotest` command
|
3
|
+
as normal:
|
4
4
|
|
5
5
|
$ autotest
|
6
6
|
|
7
|
-
|
7
|
+
## Bundler
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
The `autotest` command generates a shell command that runs your specs. If you
|
10
|
+
are using Bundler, and you want the shell command to include `bundle exec`,
|
11
|
+
require the Autotest bundler plugin in a `.autotest` file in the project's root
|
12
|
+
directory or your home directory:
|
12
13
|
|
13
14
|
# in .autotest
|
14
15
|
require "autotest/bundler"
|
16
|
+
|
17
|
+
## Upgrading from previous versions of rspec
|
18
|
+
|
19
|
+
Previous versions of RSpec used a different mechanism for telling autotest to
|
20
|
+
invoke RSpec's Autotest extension: it generated an `autotest/discover.rb` file
|
21
|
+
in the project's root directory. This is no longer necessary with the new
|
22
|
+
approach of RSpec looking for a `.rspec` file, so feel free to delete the
|
23
|
+
`autotest/discover.rb` file in the project root if you have one.
|
24
|
+
|
25
|
+
## Gotchas
|
26
|
+
|
27
|
+
### Invalid Option: --tty
|
28
|
+
|
29
|
+
The `--tty` option was [added in rspec-core-2.2.1](changelog), and is used
|
30
|
+
internally by RSpec. If you see an error citing it as an invalid option, you'll
|
31
|
+
probably see there are two or more versions of rspec-core in the backtrace: one
|
32
|
+
< 2.2.1 and one >= 2.2.1.
|
33
|
+
|
34
|
+
This usually happens because you have a newer rspec-core installed, and an
|
35
|
+
older rspec-core specified in a Bundler Gemfile. If this is the case, you can:
|
36
|
+
|
37
|
+
1. specify the newer version in the Gemfile (recommended)
|
38
|
+
2. prefix the `autotest` command with `bundle exec`
|
data/features/Changelog.md
CHANGED
@@ -1,11 +1,41 @@
|
|
1
|
-
### 2.
|
1
|
+
### 2.6.0.rc2 / 2011-04-18
|
2
2
|
|
3
|
-
[full changelog](http://github.com/rspec/rspec-core/compare/v2.5.1...v2.
|
3
|
+
[full changelog](http://github.com/rspec/rspec-core/compare/v2.5.1...v2.6.1.rc2)
|
4
4
|
|
5
5
|
* Enhancements
|
6
|
-
*
|
6
|
+
* `shared_context` (Damian Nurzynski)
|
7
|
+
* extend groups matching specific metadata with:
|
8
|
+
* method definitions
|
9
|
+
* subject declarations
|
10
|
+
* let/let! declarations
|
11
|
+
* etc (anything you can do in a group)
|
12
|
+
* `its([:key])` works for any subject with #[]. (Peter Jaros)
|
13
|
+
* `treat_symbols_as_metadata_keys_with_true_values` (Myron Marston)
|
14
|
+
* Print a deprecation warning when you configure RSpec after defining
|
15
|
+
an example. All configuration should happen before any examples are
|
16
|
+
defined. (Myron Marston)
|
17
|
+
* Pass the exit status of a DRb run to the invoking process. This causes
|
18
|
+
specs run via DRb to not just return true or false. (Ilkka Laukkanen)
|
19
|
+
* Refactoring of ConfigurationOptions#parse_options (Rodrigo Rosenfeld Rosas)
|
20
|
+
* Report excluded filters in runner output (tip from andyl)
|
7
21
|
|
8
|
-
|
22
|
+
* Bug fixes
|
23
|
+
* Don't stumble over an exception without a message (Hans Hasselberg)
|
24
|
+
* Remove non-ascii characters from comments that were choking rcov (Geoffrey
|
25
|
+
Byers)
|
26
|
+
* Fixed backtrace so it doesn't include lines from before the autorun at_exit
|
27
|
+
hook (Myron Marston)
|
28
|
+
* Include RSpec::Matchers when first example group is defined, rather
|
29
|
+
than just before running the examples. This works around an obscure
|
30
|
+
bug in ruby 1.9 that can cause infinite recursion. (Myron Marston)
|
31
|
+
* Don't send example_group_[started|finished] to formatters for empty groups.
|
32
|
+
* Get specs passing on jruby (Sidu Ponnappa)
|
33
|
+
* Fix bug where mixing nested groups and outer-level examples gave
|
34
|
+
unpredictable :line_number behavior (Artur Małecki)
|
35
|
+
* Regexp.escape the argument to --example (tip from Elliot Winkler)
|
36
|
+
* Correctly pass/fail pending block with message expectations
|
37
|
+
|
38
|
+
### 2.5.1 / 2011-02-06
|
9
39
|
|
10
40
|
[full changelog](http://github.com/rspec/rspec-core/compare/v2.5.0...v2.5.1)
|
11
41
|
|
@@ -75,7 +105,7 @@ If you don't want 'bundle exec', there is nothing you have to do.
|
|
75
105
|
|
76
106
|
* Bug fixes
|
77
107
|
* send debugger warning message to $stdout if RSpec.configuration.error_stream
|
78
|
-
has not been defined yet.
|
108
|
+
has not been defined yet.
|
79
109
|
* HTML Formatter _finally_ properly displays nested groups (Jarmo Pertman)
|
80
110
|
* eliminate some warnings when running RSpec's own suite (Jarmo Pertman)
|
81
111
|
|
@@ -103,7 +133,7 @@ If you don't want 'bundle exec', there is nothing you have to do.
|
|
103
133
|
|
104
134
|
* Bug fixes
|
105
135
|
* alias_method instead of override Kernel#method_missing (John Wilger)
|
106
|
-
* changed --autotest to --tty in generated command (MIKAMI Yoshiyuki)
|
136
|
+
* changed --autotest to --tty in generated command (MIKAMI Yoshiyuki)
|
107
137
|
* revert change to debugger (had introduced conflict with Rails)
|
108
138
|
* also restored --debugger/-debug option
|
109
139
|
|
@@ -8,7 +8,7 @@ Feature: --configure option
|
|
8
8
|
to load RSpec's Autotest subclass.
|
9
9
|
|
10
10
|
Scenario: generate .rspec file for autotest
|
11
|
-
When I run
|
11
|
+
When I run `rspec --configure autotest`
|
12
12
|
Then the following files should exist:
|
13
13
|
| .rspec |
|
14
14
|
And the output should contain ".rspec file did not exist, so it was created."
|
@@ -18,5 +18,5 @@ Feature: --configure option
|
|
18
18
|
"""
|
19
19
|
--color
|
20
20
|
"""
|
21
|
-
When I run
|
21
|
+
When I run `rspec --configure autotest`
|
22
22
|
Then the output should contain ".rspec file already exists, so nothing was changed."
|
@@ -46,41 +46,41 @@ Feature: --example option
|
|
46
46
|
"""
|
47
47
|
|
48
48
|
Scenario: no matches
|
49
|
-
When I run
|
49
|
+
When I run `rspec . --example nothing_like_this`
|
50
50
|
Then the examples should all pass
|
51
51
|
|
52
52
|
Scenario: match on one word
|
53
|
-
When I run
|
53
|
+
When I run `rspec . --example example`
|
54
54
|
Then the examples should all pass
|
55
55
|
|
56
56
|
Scenario: one match in each context
|
57
|
-
When I run
|
57
|
+
When I run `rspec . --example 'first example'`
|
58
58
|
Then the examples should all pass
|
59
59
|
|
60
60
|
Scenario: one match in one file using just the example name
|
61
|
-
When I run
|
61
|
+
When I run `rspec . --example 'first example in first group'`
|
62
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
|
-
When I run
|
65
|
+
When I run `rspec . --example 'first group first example in first group'`
|
66
66
|
Then the examples should all pass
|
67
67
|
|
68
68
|
Scenario: one match in one file using regexp
|
69
|
-
When I run
|
69
|
+
When I run `rspec . --example 'first .* first example'`
|
70
70
|
Then the examples should all pass
|
71
71
|
|
72
72
|
Scenario: all examples in one group
|
73
|
-
When I run
|
73
|
+
When I run `rspec . --example 'first group'`
|
74
74
|
Then the examples should all pass
|
75
75
|
|
76
76
|
Scenario: one match in one file with group name
|
77
|
-
When I run
|
77
|
+
When I run `rspec . --example 'second group first example'`
|
78
78
|
Then the examples should all pass
|
79
79
|
|
80
80
|
Scenario: all examples in one group including examples in nested groups
|
81
|
-
When I run
|
81
|
+
When I run `rspec . --example 'third group'`
|
82
82
|
Then the examples should all pass
|
83
83
|
|
84
84
|
Scenario: Object#method
|
85
|
-
When I run
|
85
|
+
When I run `rspec . --example 'Array#length'`
|
86
86
|
Then the examples should all pass
|
@@ -11,7 +11,7 @@ Feature: exit status
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
"""
|
14
|
-
When I run
|
14
|
+
When I run `rspec ok_spec.rb`
|
15
15
|
Then the exit status should be 0
|
16
16
|
And the examples should all pass
|
17
17
|
|
@@ -24,7 +24,7 @@ Feature: exit status
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
"""
|
27
|
-
When I run
|
27
|
+
When I run `rspec ko_spec.rb`
|
28
28
|
Then the exit status should be 1
|
29
29
|
And the output should contain "1 example, 1 failure"
|
30
30
|
|
@@ -39,7 +39,7 @@ Feature: exit status
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
"""
|
42
|
-
When I run
|
42
|
+
When I run `rspec nested_ko_spec.rb`
|
43
43
|
Then the exit status should be 1
|
44
44
|
And the output should contain "1 example, 1 failure"
|
45
45
|
|
@@ -47,6 +47,6 @@ Feature: exit status
|
|
47
47
|
Given a file named "a_no_examples_spec.rb" with:
|
48
48
|
"""
|
49
49
|
"""
|
50
|
-
When I run
|
50
|
+
When I run `rspec a_no_examples_spec.rb`
|
51
51
|
Then the exit status should be 0
|
52
52
|
And the output should contain "0 examples"
|
@@ -38,11 +38,11 @@ Feature: --format option
|
|
38
38
|
"""
|
39
39
|
|
40
40
|
Scenario: progress bar format (default)
|
41
|
-
When I run
|
41
|
+
When I run `rspec example_spec.rb`
|
42
42
|
Then the output should contain ".F*"
|
43
43
|
|
44
44
|
Scenario: documentation format
|
45
|
-
When I run
|
45
|
+
When I run `rspec example_spec.rb --format documentation`
|
46
46
|
Then the output should contain:
|
47
47
|
"""
|
48
48
|
something
|
@@ -52,7 +52,7 @@ Feature: --format option
|
|
52
52
|
"""
|
53
53
|
|
54
54
|
Scenario: documentation format saved to a file
|
55
|
-
When I run
|
55
|
+
When I run `rspec example_spec.rb --format documentation --out rspec.txt`
|
56
56
|
Then the file "rspec.txt" should contain:
|
57
57
|
"""
|
58
58
|
something
|
@@ -62,7 +62,7 @@ Feature: --format option
|
|
62
62
|
"""
|
63
63
|
|
64
64
|
Scenario: multiple formats
|
65
|
-
When I run
|
65
|
+
When I run `rspec example_spec.rb --format progress --format documentation --out rspec.txt`
|
66
66
|
Then the output should contain ".F*"
|
67
67
|
And the file "rspec.txt" should contain:
|
68
68
|
"""
|
@@ -29,77 +29,77 @@ Feature: line number appended to file path
|
|
29
29
|
"""
|
30
30
|
|
31
31
|
Scenario: nested groups - outer group on declaration line
|
32
|
-
When I run
|
32
|
+
When I run `rspec example_spec.rb:1 --format doc`
|
33
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
|
-
When I run
|
39
|
+
When I run `rspec example_spec.rb:2 --format doc`
|
40
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
|
-
When I run
|
46
|
+
When I run `rspec example_spec.rb:11 --format doc`
|
47
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
|
-
When I run
|
53
|
+
When I run `rspec example_spec.rb:12 --format doc`
|
54
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
|
-
When I run
|
60
|
+
When I run `rspec example_spec.rb:3 --format doc`
|
61
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
|
-
When I run
|
67
|
+
When I run `rspec example_spec.rb:4 --format doc`
|
68
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
|
-
When I run
|
74
|
+
When I run `rspec example_spec.rb:5 --format doc`
|
75
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
|
-
When I run
|
81
|
+
When I run `rspec example_spec.rb:6 --format doc`
|
82
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
|
-
When I run
|
88
|
+
When I run `rspec example_spec.rb:7 --format doc`
|
89
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
|
-
When I run
|
95
|
+
When I run `rspec example_spec.rb:7 --format doc`
|
96
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
|
-
When I run
|
102
|
+
When I run `rspec example_spec.rb:7 --format doc`
|
103
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"
|