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
@@ -1,8 +1,8 @@
|
|
1
|
-
Feature: --
|
1
|
+
Feature: --line_number option
|
2
2
|
|
3
|
-
To run a single example or group, you can use the --
|
3
|
+
To run a single example or group, you can use the --line_number option:
|
4
4
|
|
5
|
-
rspec path/to/example_spec.rb --
|
5
|
+
rspec path/to/example_spec.rb --line_number 37
|
6
6
|
|
7
7
|
Scenario: standard examples
|
8
8
|
Given a file named "example_spec.rb" with:
|
@@ -21,10 +21,10 @@ Feature: --line option
|
|
21
21
|
|
22
22
|
end
|
23
23
|
"""
|
24
|
-
When I run "rspec example_spec.rb --
|
25
|
-
Then the
|
24
|
+
When I run "rspec example_spec.rb --line_number 5 --format doc"
|
25
|
+
Then the examples should all pass
|
26
26
|
Then the output should contain "should be > 8"
|
27
|
-
But the
|
27
|
+
But the output should not contain "should be < 10"
|
28
28
|
|
29
29
|
Scenario: one liner
|
30
30
|
Given a file named "example_spec.rb" with:
|
@@ -39,7 +39,7 @@ Feature: --line option
|
|
39
39
|
|
40
40
|
end
|
41
41
|
"""
|
42
|
-
When I run "rspec example_spec.rb --
|
43
|
-
Then the
|
42
|
+
When I run "rspec example_spec.rb --line_number 5 --format doc"
|
43
|
+
Then the examples should all pass
|
44
44
|
Then the output should contain "should be > 8"
|
45
|
-
But the
|
45
|
+
But the output should not contain "should be < 10"
|
@@ -28,17 +28,17 @@ Feature: --tag option
|
|
28
28
|
|
29
29
|
Scenario: filter examples with non-existent tag
|
30
30
|
When I run "rspec . --tag mytag"
|
31
|
-
And the
|
31
|
+
And the examples should all pass
|
32
32
|
|
33
33
|
Scenario: filter examples with a simple tag
|
34
34
|
When I run "rspec . --tag focus"
|
35
35
|
Then the output should contain "Run filtered using {:focus=>true}"
|
36
|
-
And the
|
36
|
+
And the examples should all pass
|
37
37
|
|
38
38
|
Scenario: filter examples with a simple tag and @
|
39
39
|
When I run "rspec . --tag @focus"
|
40
40
|
Then the output should contain "Run filtered using {:focus=>true}"
|
41
|
-
Then the
|
41
|
+
Then the examples should all pass
|
42
42
|
|
43
43
|
Scenario: filter examples with a name:value tag
|
44
44
|
When I run "rspec . --tag type:special"
|
@@ -46,7 +46,7 @@ Feature: --tag option
|
|
46
46
|
"""
|
47
47
|
Run filtered using {:type=>"special"}
|
48
48
|
"""
|
49
|
-
And the
|
49
|
+
And the examples should all pass
|
50
50
|
|
51
51
|
Scenario: filter examples with a name:value tag and @
|
52
52
|
When I run "rspec . --tag @type:special"
|
@@ -54,21 +54,21 @@ Feature: --tag option
|
|
54
54
|
"""
|
55
55
|
Run filtered using {:type=>"special"}
|
56
56
|
"""
|
57
|
-
And the
|
57
|
+
And the examples should all pass
|
58
58
|
|
59
59
|
Scenario: exclude examples with a simple tag
|
60
60
|
When I run "rspec . --tag ~skip"
|
61
|
-
Then the
|
61
|
+
Then the examples should all pass
|
62
62
|
|
63
63
|
Scenario: exclude examples with a simple tag and @
|
64
64
|
When I run "rspec . --tag ~@skip"
|
65
|
-
Then the
|
65
|
+
Then the examples should all pass
|
66
66
|
|
67
67
|
Scenario: exclude examples with a name:value tag
|
68
68
|
When I run "rspec . --tag ~speed:slow"
|
69
|
-
Then the
|
69
|
+
Then the examples should all pass
|
70
70
|
|
71
71
|
Scenario: exclude examples with a name:value tag and @
|
72
72
|
When I run "rspec . --tag ~@speed:slow"
|
73
|
-
Then the
|
73
|
+
Then the examples should all pass
|
74
74
|
|
@@ -30,7 +30,7 @@ Feature: custom settings
|
|
30
30
|
end
|
31
31
|
"""
|
32
32
|
When I run "rspec ./additional_setting_spec.rb"
|
33
|
-
Then the
|
33
|
+
Then the examples should all pass
|
34
34
|
|
35
35
|
Scenario: default to true
|
36
36
|
Given a file named "additional_setting_spec.rb" with:
|
@@ -56,7 +56,7 @@ Feature: custom settings
|
|
56
56
|
end
|
57
57
|
"""
|
58
58
|
When I run "rspec ./additional_setting_spec.rb"
|
59
|
-
Then the
|
59
|
+
Then the examples should all pass
|
60
60
|
|
61
61
|
Scenario: overridden in a subsequent RSpec.configure block
|
62
62
|
Given a file named "additional_setting_spec.rb" with:
|
@@ -80,5 +80,5 @@ Feature: custom settings
|
|
80
80
|
end
|
81
81
|
"""
|
82
82
|
When I run "rspec ./additional_setting_spec.rb"
|
83
|
-
Then the
|
83
|
+
Then the examples should all pass
|
84
84
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Feature: fail fast
|
2
2
|
|
3
|
-
Use the fail_fast option to tell RSpec to abort the run on first failure
|
3
|
+
Use the fail_fast option to tell RSpec to abort the run on first failure:
|
4
4
|
|
5
|
-
|
5
|
+
RSpec.configure {|c| c.fail_fast = true}
|
6
6
|
|
7
7
|
Background:
|
8
8
|
Given a file named "spec/spec_helper.rb" with:
|
@@ -22,7 +22,7 @@ Feature: fail fast
|
|
22
22
|
end
|
23
23
|
"""
|
24
24
|
When I run "rspec spec/example_spec.rb"
|
25
|
-
Then the
|
25
|
+
Then the examples should all pass
|
26
26
|
|
27
27
|
Scenario: fail_fast with first example failing (only runs the one example)
|
28
28
|
Given a file named "spec/example_spec.rb" with:
|
@@ -31,7 +31,7 @@ Feature: read command line configuration options from files
|
|
31
31
|
end
|
32
32
|
"""
|
33
33
|
When I run "rspec ./spec/example_spec.rb"
|
34
|
-
Then the
|
34
|
+
Then the examples should all pass
|
35
35
|
|
36
36
|
Scenario: custom options file
|
37
37
|
Given a file named "my.options" with:
|
@@ -48,7 +48,7 @@ Feature: read command line configuration options from files
|
|
48
48
|
end
|
49
49
|
"""
|
50
50
|
When I run "rspec spec/example_spec.rb --options my.options"
|
51
|
-
Then the
|
51
|
+
Then the examples should all pass
|
52
52
|
|
53
53
|
Scenario: RSpec ignores ./.rspec when custom options file is used
|
54
54
|
Given a file named "my.options" with:
|
@@ -68,7 +68,7 @@ Feature: read command line configuration options from files
|
|
68
68
|
end
|
69
69
|
"""
|
70
70
|
When I run "rspec spec/example_spec.rb --options my.options"
|
71
|
-
Then the
|
71
|
+
Then the examples should all pass
|
72
72
|
|
73
73
|
Scenario: using ERB in .rspec
|
74
74
|
Given a file named ".rspec" with:
|
@@ -84,4 +84,4 @@ Feature: read command line configuration options from files
|
|
84
84
|
end
|
85
85
|
"""
|
86
86
|
When I run "rspec ./spec/example_spec.rb"
|
87
|
-
Then the
|
87
|
+
Then the examples should all pass
|
@@ -46,7 +46,7 @@ Feature: shared example group
|
|
46
46
|
end
|
47
47
|
"""
|
48
48
|
When I run "rspec collection_spec.rb --format documentation"
|
49
|
-
Then the
|
49
|
+
Then the examples should all pass
|
50
50
|
And the output should contain:
|
51
51
|
"""
|
52
52
|
Array
|
@@ -98,7 +98,7 @@ Feature: shared example group
|
|
98
98
|
end
|
99
99
|
"""
|
100
100
|
When I run "rspec shared_example_group_spec.rb --format documentation"
|
101
|
-
Then the
|
101
|
+
Then the examples should all pass
|
102
102
|
And the output should contain:
|
103
103
|
"""
|
104
104
|
Array
|
@@ -134,7 +134,7 @@ Feature: shared example group
|
|
134
134
|
end
|
135
135
|
"""
|
136
136
|
When I run "rspec shared_example_group_params_spec.rb --format documentation"
|
137
|
-
Then the
|
137
|
+
Then the examples should all pass
|
138
138
|
And the output should contain:
|
139
139
|
"""
|
140
140
|
Array with 3 items
|
@@ -168,7 +168,7 @@ Feature: shared example group
|
|
168
168
|
end
|
169
169
|
"""
|
170
170
|
When I run "rspec shared_example_group_spec.rb --format documentation"
|
171
|
-
Then the
|
171
|
+
Then the examples should all pass
|
172
172
|
And the output should contain:
|
173
173
|
"""
|
174
174
|
String
|
@@ -3,9 +3,11 @@ Feature: configure expectation framework
|
|
3
3
|
By default, RSpec is configured to include rspec-expectations for expressing
|
4
4
|
desired outcomes. You can also configure RSpec to use:
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
* rspec/expectations (explicitly)
|
7
|
+
* stdlib assertions
|
8
|
+
* test/unit assertions in ruby 1.8
|
9
|
+
* minitest assertions in ruby 1.9
|
10
|
+
* rspec/expecations _and_ stlib assertions
|
9
11
|
|
10
12
|
Scenario: configure rspec-expectations (explicitly)
|
11
13
|
Given a file named "example_spec.rb" with:
|
@@ -21,8 +23,7 @@ Feature: configure expectation framework
|
|
21
23
|
end
|
22
24
|
"""
|
23
25
|
When I run "rspec example_spec.rb"
|
24
|
-
Then the
|
25
|
-
And the exit status should be 0
|
26
|
+
Then the examples should all pass
|
26
27
|
|
27
28
|
Scenario: configure test/unit assertions
|
28
29
|
Given a file named "example_spec.rb" with:
|
@@ -38,8 +39,7 @@ Feature: configure expectation framework
|
|
38
39
|
end
|
39
40
|
"""
|
40
41
|
When I run "rspec example_spec.rb"
|
41
|
-
Then the
|
42
|
-
And the exit status should be 0
|
42
|
+
Then the examples should all pass
|
43
43
|
|
44
44
|
Scenario: configure rspec/expecations AND test/unit assertions
|
45
45
|
Given a file named "example_spec.rb" with:
|
@@ -59,5 +59,4 @@ Feature: configure expectation framework
|
|
59
59
|
end
|
60
60
|
"""
|
61
61
|
When I run "rspec example_spec.rb"
|
62
|
-
Then the
|
63
|
-
And the exit status should be 0
|
62
|
+
Then the examples should all pass
|
@@ -79,7 +79,7 @@ Feature: exclusion filters
|
|
79
79
|
"""
|
80
80
|
When I run "rspec ./spec/sample_spec.rb --format doc"
|
81
81
|
Then the output should match /No examples were matched. Perhaps \{.*:broken=>true.*\} is excluding everything?/
|
82
|
-
And the
|
82
|
+
And the examples should all pass
|
83
83
|
And the output should not contain "group 1"
|
84
84
|
And the output should not contain "group 2"
|
85
85
|
|
@@ -33,7 +33,7 @@ Feature: run all when everything filtered
|
|
33
33
|
"""
|
34
34
|
When I run "rspec spec/sample_spec.rb --format doc"
|
35
35
|
Then the output should contain "No examples were matched by {:focus=>true}, running all"
|
36
|
-
And the
|
36
|
+
And the examples should all pass
|
37
37
|
And the output should contain:
|
38
38
|
"""
|
39
39
|
group 1
|
@@ -1,32 +1,36 @@
|
|
1
1
|
Feature: custom formatters
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
RSpec ships with general purpose output formatters. You can tell RSpec which
|
4
|
+
one to use using the [`--format` command line
|
5
|
+
option]('../command_line/format_option').
|
6
|
+
|
7
|
+
When RSpec's built-in output formatters don't, however, give you everything
|
8
|
+
you need, you can write your own custom formatter and tell RSpec to use that
|
9
|
+
one instead. The simplest way is to subclass RSpec's `BaseTextFormatter`,
|
10
|
+
and then override just the methods that you want to modify.
|
6
11
|
|
7
|
-
|
8
|
-
Scenario: specdoc format
|
12
|
+
Scenario: custom formatter
|
9
13
|
Given a file named "custom_formatter.rb" with:
|
10
14
|
"""
|
11
|
-
require "rspec/
|
15
|
+
require "rspec/core/formatters/base_text_formatter"
|
12
16
|
|
13
|
-
class CustomFormatter < RSpec::
|
14
|
-
def initialize(
|
15
|
-
|
17
|
+
class CustomFormatter < RSpec::Core::Formatters::BaseTextFormatter
|
18
|
+
def initialize(output)
|
19
|
+
super(output)
|
16
20
|
end
|
21
|
+
|
17
22
|
def example_started(proxy)
|
18
|
-
|
23
|
+
output << "example: " << proxy.description
|
19
24
|
end
|
20
25
|
end
|
21
26
|
"""
|
22
|
-
And a file named "
|
27
|
+
And a file named "example_spec.rb" with:
|
23
28
|
"""
|
24
29
|
describe "my group" do
|
25
30
|
specify "my example" do
|
26
31
|
end
|
27
32
|
end
|
28
33
|
"""
|
29
|
-
|
30
|
-
When I run "rspec ./simple_example_spec.rb --require custom_formatter.rb --format CustomFormatter"
|
34
|
+
When I run "rspec example_spec.rb --require ./custom_formatter.rb --format CustomFormatter"
|
31
35
|
Then the output should contain "example: my example"
|
32
36
|
And the exit status should be 0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Feature: arbitrary helper methods
|
2
|
+
|
3
|
+
You can define methods in any example group using Ruby's `def` keyword or
|
4
|
+
`define_method` method. These _helper_ methods are exposed to examples in the
|
5
|
+
group in which they are defined and groups nested within that group, but not
|
6
|
+
parent or sibling groups.
|
7
|
+
|
8
|
+
Scenario: use a method defined in the same group
|
9
|
+
Given a file named "example_spec.rb" with:
|
10
|
+
"""
|
11
|
+
describe "an example" do
|
12
|
+
def help
|
13
|
+
:available
|
14
|
+
end
|
15
|
+
|
16
|
+
it "has access to methods defined in its group" do
|
17
|
+
help.should be(:available)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
"""
|
21
|
+
When I run "rspec example_spec.rb"
|
22
|
+
Then the examples should all pass
|
23
|
+
|
24
|
+
Scenario: use a method defined in a parent group
|
25
|
+
Given a file named "example_spec.rb" with:
|
26
|
+
"""
|
27
|
+
describe "an example" do
|
28
|
+
def help
|
29
|
+
:available
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "in a nested group" do
|
33
|
+
it "has access to methods defined in its parent group" do
|
34
|
+
help.should be(:available)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
"""
|
39
|
+
When I run "rspec example_spec.rb"
|
40
|
+
Then the examples should all pass
|
@@ -0,0 +1,50 @@
|
|
1
|
+
Feature: let and let!
|
2
|
+
|
3
|
+
Use `let` to define a memoized helper method. The value will be cached
|
4
|
+
across multiple calls in the same example but not across examples.
|
5
|
+
|
6
|
+
Note that `let` is lazy-evaluated: it is not evaluated until the first time
|
7
|
+
the method it defines is invoked. You can use `let!` to force the method's
|
8
|
+
invocation before each example.
|
9
|
+
|
10
|
+
Scenario: use let to define memoized helper method
|
11
|
+
Given a file named "let_spec.rb" with:
|
12
|
+
"""
|
13
|
+
$count = 0
|
14
|
+
describe "let" do
|
15
|
+
let(:count) { $count += 1 }
|
16
|
+
|
17
|
+
it "memoizes the value" do
|
18
|
+
count.should == 1
|
19
|
+
count.should == 1
|
20
|
+
end
|
21
|
+
|
22
|
+
it "is not cached across examples" do
|
23
|
+
count.should == 2
|
24
|
+
end
|
25
|
+
end
|
26
|
+
"""
|
27
|
+
When I run "rspec let_spec.rb"
|
28
|
+
Then the examples should all pass
|
29
|
+
|
30
|
+
Scenario: use let! to define a memoized helper method that is called in a before hook
|
31
|
+
Given a file named "let_bang_spec.rb" with:
|
32
|
+
"""
|
33
|
+
$count = 0
|
34
|
+
describe "let!" do
|
35
|
+
invocation_order = []
|
36
|
+
|
37
|
+
let!(:count) do
|
38
|
+
invocation_order << :let!
|
39
|
+
$count += 1
|
40
|
+
end
|
41
|
+
|
42
|
+
it "calls the helper method in a before hook" do
|
43
|
+
invocation_order << :example
|
44
|
+
invocation_order.should == [:let!, :example]
|
45
|
+
count.should == 1
|
46
|
+
end
|
47
|
+
end
|
48
|
+
"""
|
49
|
+
When I run "rspec let_bang_spec.rb"
|
50
|
+
Then the examples should all pass
|
@@ -53,7 +53,7 @@ Feature: before and after hooks
|
|
53
53
|
end
|
54
54
|
"""
|
55
55
|
When I run "rspec ./before_each_spec.rb"
|
56
|
-
Then the
|
56
|
+
Then the examples should all pass
|
57
57
|
|
58
58
|
Scenario: define before(:all) block in example group
|
59
59
|
Given a file named "before_all_spec.rb" with:
|
@@ -87,10 +87,10 @@ Feature: before and after hooks
|
|
87
87
|
end
|
88
88
|
"""
|
89
89
|
When I run "rspec ./before_all_spec.rb"
|
90
|
-
Then the
|
90
|
+
Then the examples should all pass
|
91
91
|
|
92
92
|
When I run "rspec ./before_all_spec.rb:15"
|
93
|
-
Then the
|
93
|
+
Then the examples should all pass
|
94
94
|
|
95
95
|
Scenario: failure in before(:all) block
|
96
96
|
Given a file named "before_all_spec.rb" with:
|
@@ -166,7 +166,7 @@ Feature: before and after hooks
|
|
166
166
|
end
|
167
167
|
"""
|
168
168
|
When I run "rspec after_all_spec.rb"
|
169
|
-
Then the
|
169
|
+
Then the examples should all pass
|
170
170
|
And the output should contain:
|
171
171
|
"""
|
172
172
|
An error occurred in an after(:all) hook.
|
@@ -201,7 +201,7 @@ Feature: before and after hooks
|
|
201
201
|
end
|
202
202
|
"""
|
203
203
|
When I run "rspec ./befores_in_configuration_spec.rb"
|
204
|
-
Then the
|
204
|
+
Then the examples should all pass
|
205
205
|
|
206
206
|
Scenario: before/after blocks are run in order
|
207
207
|
Given a file named "ensure_block_order_spec.rb" with:
|
@@ -317,7 +317,7 @@ Feature: before and after hooks
|
|
317
317
|
end
|
318
318
|
"""
|
319
319
|
When I run "rspec ./before_and_after_all_spec.rb"
|
320
|
-
Then the
|
320
|
+
Then the examples should all pass
|
321
321
|
And the output should contain:
|
322
322
|
"""
|
323
323
|
outer before all
|
@@ -327,7 +327,7 @@ Feature: before and after hooks
|
|
327
327
|
"""
|
328
328
|
|
329
329
|
When I run "rspec ./before_and_after_all_spec.rb:14"
|
330
|
-
Then the
|
330
|
+
Then the examples should all pass
|
331
331
|
And the output should contain:
|
332
332
|
"""
|
333
333
|
outer before all
|
@@ -337,7 +337,7 @@ Feature: before and after hooks
|
|
337
337
|
"""
|
338
338
|
|
339
339
|
When I run "rspec ./before_and_after_all_spec.rb:6"
|
340
|
-
Then the
|
340
|
+
Then the examples should all pass
|
341
341
|
And the output should contain:
|
342
342
|
"""
|
343
343
|
outer before all
|
@@ -372,7 +372,7 @@ Feature: before and after hooks
|
|
372
372
|
end
|
373
373
|
"""
|
374
374
|
When I run "rspec before_all_spec.rb"
|
375
|
-
Then the
|
375
|
+
Then the examples should all pass
|
376
376
|
|
377
377
|
Scenario: before/after all blocks have access to state
|
378
378
|
Given a file named "before_and_after_all_spec.rb" with:
|
@@ -408,7 +408,7 @@ Feature: before and after hooks
|
|
408
408
|
end
|
409
409
|
"""
|
410
410
|
When I run "rspec ./before_and_after_all_spec.rb"
|
411
|
-
Then the
|
411
|
+
Then the examples should all pass
|
412
412
|
|
413
413
|
Scenario: exception in before(:each) is captured and reported as failure
|
414
414
|
Given a file named "error_in_before_each_spec.rb" with:
|