rspec-core 2.11.1 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +59 -0
- data/README.md +22 -0
- data/features/command_line/example_name_option.feature +5 -5
- data/features/command_line/exit_status.feature +6 -6
- data/features/command_line/format_option.feature +2 -2
- data/features/command_line/line_number_appended_to_path.feature +2 -2
- data/features/command_line/line_number_option.feature +2 -2
- data/features/command_line/pattern_option.feature +2 -2
- data/features/command_line/rake_task.feature +62 -8
- data/features/command_line/ruby.feature +1 -1
- data/features/command_line/tag.feature +1 -1
- data/features/configuration/alias_example_to.feature +2 -2
- data/features/configuration/custom_settings.feature +3 -3
- data/features/configuration/default_path.feature +3 -3
- data/features/configuration/fail_fast.feature +5 -5
- data/features/configuration/read_options_from_file.feature +4 -4
- data/features/example_groups/basic_structure.feature +2 -2
- data/features/example_groups/shared_context.feature +3 -3
- data/features/example_groups/shared_examples.feature +25 -7
- data/features/expectation_framework_integration/configure_expectation_framework.feature +6 -6
- data/features/filtering/exclusion_filters.feature +5 -5
- data/features/filtering/if_and_unless.feature +5 -5
- data/features/filtering/inclusion_filters.feature +5 -5
- data/features/filtering/run_all_when_everything_filtered.feature +3 -3
- data/features/formatters/custom_formatter.feature +2 -2
- data/features/formatters/json_formatter.feature +30 -0
- data/features/formatters/text_formatter.feature +5 -5
- data/features/helper_methods/arbitrary_methods.feature +2 -2
- data/features/helper_methods/let.feature +2 -2
- data/features/helper_methods/modules.feature +6 -6
- data/features/hooks/around_hooks.feature +11 -11
- data/features/hooks/before_and_after_hooks.feature +15 -11
- data/features/hooks/filtering.feature +6 -6
- data/features/metadata/current_example.feature +1 -1
- data/features/metadata/described_class.feature +1 -1
- data/features/metadata/user_defined.feature +4 -4
- data/features/mock_framework_integration/use_any_framework.feature +6 -6
- data/features/mock_framework_integration/use_flexmock.feature +5 -5
- data/features/mock_framework_integration/use_mocha.feature +5 -5
- data/features/mock_framework_integration/use_rr.feature +5 -5
- data/features/mock_framework_integration/use_rspec.feature +5 -5
- data/features/pending/pending_examples.feature +11 -11
- data/features/spec_files/arbitrary_file_suffix.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +2 -0
- data/features/subject/attribute_of_subject.feature +5 -5
- data/features/subject/explicit_subject.feature +5 -5
- data/features/subject/implicit_receiver.feature +2 -2
- data/features/subject/implicit_subject.feature +3 -3
- data/lib/autotest/rspec2.rb +1 -1
- data/lib/rspec/core.rb +53 -32
- data/lib/rspec/core/configuration.rb +123 -15
- data/lib/rspec/core/configuration_options.rb +17 -2
- data/lib/rspec/core/example.rb +5 -4
- data/lib/rspec/core/example_group.rb +19 -9
- data/lib/rspec/core/extensions/ordered.rb +12 -6
- data/lib/rspec/core/formatters.rb +55 -0
- data/lib/rspec/core/formatters/base_formatter.rb +43 -38
- data/lib/rspec/core/formatters/base_text_formatter.rb +9 -5
- data/lib/rspec/core/formatters/documentation_formatter.rb +1 -1
- data/lib/rspec/core/formatters/helpers.rb +30 -5
- data/lib/rspec/core/formatters/html_formatter.rb +58 -368
- data/lib/rspec/core/formatters/html_printer.rb +407 -0
- data/lib/rspec/core/formatters/json_formatter.rb +73 -0
- data/lib/rspec/core/formatters/snippet_extractor.rb +3 -1
- data/lib/rspec/core/hooks.rb +4 -4
- data/lib/rspec/core/metadata.rb +14 -6
- data/lib/rspec/core/mocking/with_mocha.rb +25 -2
- data/lib/rspec/core/mocking/with_rspec.rb +6 -2
- data/lib/rspec/core/option_parser.rb +28 -7
- data/lib/rspec/core/project_initializer.rb +0 -1
- data/lib/rspec/core/rake_task.rb +49 -38
- data/lib/rspec/core/reporter.rb +2 -2
- data/lib/rspec/core/shared_example_group.rb +89 -41
- data/lib/rspec/core/subject.rb +6 -2
- data/lib/rspec/core/version.rb +1 -1
- data/lib/rspec/core/world.rb +2 -2
- data/spec/autotest/rspec_spec.rb +6 -1
- data/spec/command_line/order_spec.rb +67 -0
- data/spec/rspec/core/configuration_options_spec.rb +45 -38
- data/spec/rspec/core/configuration_spec.rb +219 -44
- data/spec/rspec/core/deprecations_spec.rb +9 -0
- data/spec/rspec/core/drb_command_line_spec.rb +1 -7
- data/spec/rspec/core/drb_options_spec.rb +1 -1
- data/spec/rspec/core/dsl_spec.rb +17 -9
- data/spec/rspec/core/example_group_spec.rb +51 -5
- data/spec/rspec/core/example_spec.rb +39 -7
- data/spec/rspec/core/filter_manager_spec.rb +20 -30
- data/spec/rspec/core/formatters/base_formatter_spec.rb +29 -1
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +6 -2
- data/spec/rspec/core/formatters/helpers_spec.rb +12 -0
- data/spec/rspec/core/formatters/html_formatted-1.8.7-rbx.html +462 -0
- data/spec/rspec/core/formatters/html_formatted-1.9.2-jruby.html +410 -0
- data/spec/rspec/core/formatters/html_formatted-1.9.3-rbx.html +462 -0
- data/spec/rspec/core/formatters/html_formatter_spec.rb +11 -3
- data/spec/rspec/core/formatters/json_formatter_spec.rb +110 -0
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +8 -0
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-rbx.html +462 -0
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2-jruby.html +410 -0
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.3-rbx.html +462 -0
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +11 -3
- data/spec/rspec/core/hooks_filtering_spec.rb +6 -6
- data/spec/rspec/core/metadata_spec.rb +29 -0
- data/spec/rspec/core/option_parser_spec.rb +42 -0
- data/spec/rspec/core/project_initializer_spec.rb +2 -2
- data/spec/rspec/core/rake_task_spec.rb +60 -17
- data/spec/rspec/core/reporter_spec.rb +17 -0
- data/spec/rspec/core/runner_spec.rb +1 -0
- data/spec/rspec/core/shared_example_group_spec.rb +17 -5
- data/spec/rspec/core/subject_spec.rb +11 -0
- data/spec/spec_helper.rb +32 -2
- data/spec/support/config_options_helper.rb +1 -10
- data/spec/support/helper_methods.rb +13 -0
- data/spec/support/isolated_directory.rb +10 -0
- data/spec/support/isolated_home_directory.rb +16 -0
- metadata +145 -148
- data/lib/rspec/core/extensions.rb +0 -4
@@ -4,7 +4,7 @@ Feature: mock with flexmock
|
|
4
4
|
|
5
5
|
Scenario: passing message expectation
|
6
6
|
Given a file named "example_spec.rb" with:
|
7
|
-
"""
|
7
|
+
"""ruby
|
8
8
|
RSpec.configure do |config|
|
9
9
|
config.mock_framework = :flexmock
|
10
10
|
end
|
@@ -22,7 +22,7 @@ Feature: mock with flexmock
|
|
22
22
|
|
23
23
|
Scenario: failing message expecation
|
24
24
|
Given a file named "example_spec.rb" with:
|
25
|
-
"""
|
25
|
+
"""ruby
|
26
26
|
RSpec.configure do |config|
|
27
27
|
config.mock_framework = :flexmock
|
28
28
|
end
|
@@ -39,7 +39,7 @@ Feature: mock with flexmock
|
|
39
39
|
|
40
40
|
Scenario: failing message expectation in pending block (remains pending)
|
41
41
|
Given a file named "example_spec.rb" with:
|
42
|
-
"""
|
42
|
+
"""ruby
|
43
43
|
RSpec.configure do |config|
|
44
44
|
config.mock_framework = :flexmock
|
45
45
|
end
|
@@ -59,7 +59,7 @@ Feature: mock with flexmock
|
|
59
59
|
|
60
60
|
Scenario: passing message expectation in pending block (fails)
|
61
61
|
Given a file named "example_spec.rb" with:
|
62
|
-
"""
|
62
|
+
"""ruby
|
63
63
|
RSpec.configure do |config|
|
64
64
|
config.mock_framework = :flexmock
|
65
65
|
end
|
@@ -81,7 +81,7 @@ Feature: mock with flexmock
|
|
81
81
|
|
82
82
|
Scenario: accessing RSpec.configuration.mock_framework.framework_name
|
83
83
|
Given a file named "example_spec.rb" with:
|
84
|
-
"""
|
84
|
+
"""ruby
|
85
85
|
RSpec.configure do |config|
|
86
86
|
config.mock_framework = :flexmock
|
87
87
|
end
|
@@ -4,7 +4,7 @@ Feature: mock with mocha
|
|
4
4
|
|
5
5
|
Scenario: passing message expectation
|
6
6
|
Given a file named "example_spec.rb" with:
|
7
|
-
"""
|
7
|
+
"""ruby
|
8
8
|
RSpec.configure do |config|
|
9
9
|
config.mock_framework = :mocha
|
10
10
|
end
|
@@ -22,7 +22,7 @@ Feature: mock with mocha
|
|
22
22
|
|
23
23
|
Scenario: failing message expecation
|
24
24
|
Given a file named "example_spec.rb" with:
|
25
|
-
"""
|
25
|
+
"""ruby
|
26
26
|
RSpec.configure do |config|
|
27
27
|
config.mock_framework = :mocha
|
28
28
|
end
|
@@ -39,7 +39,7 @@ Feature: mock with mocha
|
|
39
39
|
|
40
40
|
Scenario: failing message expectation in pending block (remains pending)
|
41
41
|
Given a file named "example_spec.rb" with:
|
42
|
-
"""
|
42
|
+
"""ruby
|
43
43
|
RSpec.configure do |config|
|
44
44
|
config.mock_framework = :mocha
|
45
45
|
end
|
@@ -59,7 +59,7 @@ Feature: mock with mocha
|
|
59
59
|
|
60
60
|
Scenario: passing message expectation in pending block (fails)
|
61
61
|
Given a file named "example_spec.rb" with:
|
62
|
-
"""
|
62
|
+
"""ruby
|
63
63
|
RSpec.configure do |config|
|
64
64
|
config.mock_framework = :mocha
|
65
65
|
end
|
@@ -81,7 +81,7 @@ Feature: mock with mocha
|
|
81
81
|
|
82
82
|
Scenario: accessing RSpec.configuration.mock_framework.framework_name
|
83
83
|
Given a file named "example_spec.rb" with:
|
84
|
-
"""
|
84
|
+
"""ruby
|
85
85
|
RSpec.configure do |config|
|
86
86
|
config.mock_framework = :mocha
|
87
87
|
end
|
@@ -4,7 +4,7 @@ Feature: mock with rr
|
|
4
4
|
|
5
5
|
Scenario: passing message expectation
|
6
6
|
Given a file named "example_spec.rb" with:
|
7
|
-
"""
|
7
|
+
"""ruby
|
8
8
|
RSpec.configure do |config|
|
9
9
|
config.mock_framework = :rr
|
10
10
|
end
|
@@ -22,7 +22,7 @@ Feature: mock with rr
|
|
22
22
|
|
23
23
|
Scenario: failing message expecation
|
24
24
|
Given a file named "example_spec.rb" with:
|
25
|
-
"""
|
25
|
+
"""ruby
|
26
26
|
RSpec.configure do |config|
|
27
27
|
config.mock_framework = :rr
|
28
28
|
end
|
@@ -39,7 +39,7 @@ Feature: mock with rr
|
|
39
39
|
|
40
40
|
Scenario: failing message expectation in pending block (remains pending)
|
41
41
|
Given a file named "example_spec.rb" with:
|
42
|
-
"""
|
42
|
+
"""ruby
|
43
43
|
RSpec.configure do |config|
|
44
44
|
config.mock_framework = :rr
|
45
45
|
end
|
@@ -59,7 +59,7 @@ Feature: mock with rr
|
|
59
59
|
|
60
60
|
Scenario: passing message expectation in pending block (fails)
|
61
61
|
Given a file named "example_spec.rb" with:
|
62
|
-
"""
|
62
|
+
"""ruby
|
63
63
|
RSpec.configure do |config|
|
64
64
|
config.mock_framework = :rr
|
65
65
|
end
|
@@ -81,7 +81,7 @@ Feature: mock with rr
|
|
81
81
|
|
82
82
|
Scenario: accessing RSpec.configuration.mock_framework.framework_name
|
83
83
|
Given a file named "example_spec.rb" with:
|
84
|
-
"""
|
84
|
+
"""ruby
|
85
85
|
RSpec.configure do |config|
|
86
86
|
config.mock_framework = :rr
|
87
87
|
end
|
@@ -5,7 +5,7 @@ Feature: mock with rspec
|
|
5
5
|
|
6
6
|
Scenario: passing message expectation
|
7
7
|
Given a file named "example_spec.rb" with:
|
8
|
-
"""
|
8
|
+
"""ruby
|
9
9
|
RSpec.configure do |config|
|
10
10
|
config.mock_framework = :rspec
|
11
11
|
end
|
@@ -23,7 +23,7 @@ Feature: mock with rspec
|
|
23
23
|
|
24
24
|
Scenario: failing message expecation
|
25
25
|
Given a file named "example_spec.rb" with:
|
26
|
-
"""
|
26
|
+
"""ruby
|
27
27
|
RSpec.configure do |config|
|
28
28
|
config.mock_framework = :rspec
|
29
29
|
end
|
@@ -40,7 +40,7 @@ Feature: mock with rspec
|
|
40
40
|
|
41
41
|
Scenario: failing message expectation in pending block (remains pending)
|
42
42
|
Given a file named "example_spec.rb" with:
|
43
|
-
"""
|
43
|
+
"""ruby
|
44
44
|
RSpec.configure do |config|
|
45
45
|
config.mock_framework = :rspec
|
46
46
|
end
|
@@ -60,7 +60,7 @@ Feature: mock with rspec
|
|
60
60
|
|
61
61
|
Scenario: passing message expectation in pending block (fails)
|
62
62
|
Given a file named "example_spec.rb" with:
|
63
|
-
"""
|
63
|
+
"""ruby
|
64
64
|
RSpec.configure do |config|
|
65
65
|
config.mock_framework = :rspec
|
66
66
|
end
|
@@ -82,7 +82,7 @@ Feature: mock with rspec
|
|
82
82
|
|
83
83
|
Scenario: accessing RSpec.configuration.mock_framework.framework_name
|
84
84
|
Given a file named "example_spec.rb" with:
|
85
|
-
"""
|
85
|
+
"""ruby
|
86
86
|
RSpec.configure do |config|
|
87
87
|
config.mock_framework = :rspec
|
88
88
|
end
|
@@ -5,7 +5,7 @@ Feature: pending examples
|
|
5
5
|
|
6
6
|
Scenario: pending implementation
|
7
7
|
Given a file named "example_without_block_spec.rb" with:
|
8
|
-
"""
|
8
|
+
"""ruby
|
9
9
|
describe "an example" do
|
10
10
|
it "is a pending example"
|
11
11
|
end
|
@@ -16,9 +16,9 @@ Feature: pending examples
|
|
16
16
|
And the output should contain "Not yet implemented"
|
17
17
|
And the output should contain "example_without_block_spec.rb:2"
|
18
18
|
|
19
|
-
Scenario: pending any
|
19
|
+
Scenario: pending any arbitrary reason, with no block
|
20
20
|
Given a file named "pending_without_block_spec.rb" with:
|
21
|
-
"""
|
21
|
+
"""ruby
|
22
22
|
describe "an example" do
|
23
23
|
it "is implemented but waiting" do
|
24
24
|
pending("something else getting finished")
|
@@ -37,9 +37,9 @@ Feature: pending examples
|
|
37
37
|
# ./pending_without_block_spec.rb:2
|
38
38
|
"""
|
39
39
|
|
40
|
-
Scenario: pending any
|
40
|
+
Scenario: pending any arbitrary reason, with a block that fails
|
41
41
|
Given a file named "pending_with_failing_block_spec.rb" with:
|
42
|
-
"""
|
42
|
+
"""ruby
|
43
43
|
describe "an example" do
|
44
44
|
it "is implemented but waiting" do
|
45
45
|
pending("something else getting finished") do
|
@@ -59,9 +59,9 @@ Feature: pending examples
|
|
59
59
|
# ./pending_with_failing_block_spec.rb:2
|
60
60
|
"""
|
61
61
|
|
62
|
-
Scenario: pending any
|
62
|
+
Scenario: pending any arbitrary reason, with a block that passes
|
63
63
|
Given a file named "pending_with_passing_block_spec.rb" with:
|
64
|
-
"""
|
64
|
+
"""ruby
|
65
65
|
describe "an example" do
|
66
66
|
it "is implemented but waiting" do
|
67
67
|
pending("something else getting finished") do
|
@@ -79,7 +79,7 @@ Feature: pending examples
|
|
79
79
|
|
80
80
|
Scenario: temporarily pending by prefixing `it`, `specify`, or `example` with an x
|
81
81
|
Given a file named "temporarily_pending_spec.rb" with:
|
82
|
-
"""
|
82
|
+
"""ruby
|
83
83
|
describe "an example" do
|
84
84
|
xit "is pending using xit" do
|
85
85
|
end
|
@@ -110,7 +110,7 @@ Feature: pending examples
|
|
110
110
|
|
111
111
|
Scenario: example with no docstring and pending method using documentation formatter
|
112
112
|
Given a file named "pending_with_no_docstring_spec.rb" with:
|
113
|
-
"""
|
113
|
+
"""ruby
|
114
114
|
describe "an example" do
|
115
115
|
it "checks something" do
|
116
116
|
(3+4).should eq(7)
|
@@ -132,7 +132,7 @@ Feature: pending examples
|
|
132
132
|
|
133
133
|
Scenario: pending with no docstring using documentation formatter
|
134
134
|
Given a file named "pending_with_no_docstring_spec.rb" with:
|
135
|
-
"""
|
135
|
+
"""ruby
|
136
136
|
describe "an example" do
|
137
137
|
it "checks something" do
|
138
138
|
(3+4).should eq(7)
|
@@ -154,7 +154,7 @@ Feature: pending examples
|
|
154
154
|
|
155
155
|
Scenario: conditionally pending examples
|
156
156
|
Given a file named "conditionally_pending_spec.rb" with:
|
157
|
-
"""
|
157
|
+
"""ruby
|
158
158
|
describe "a failing spec" do
|
159
159
|
def run_test; raise "failure"; end
|
160
160
|
|
@@ -23,7 +23,7 @@ Feature: attribute of subject
|
|
23
23
|
|
24
24
|
Scenario: specify value of an attribute
|
25
25
|
Given a file named "example_spec.rb" with:
|
26
|
-
"""
|
26
|
+
"""ruby
|
27
27
|
describe Array do
|
28
28
|
context "when first created" do
|
29
29
|
its(:size) { should eq(0) }
|
@@ -41,7 +41,7 @@ Feature: attribute of subject
|
|
41
41
|
|
42
42
|
Scenario: specify value of a nested attribute
|
43
43
|
Given a file named "example_spec.rb" with:
|
44
|
-
"""
|
44
|
+
"""ruby
|
45
45
|
class Person
|
46
46
|
attr_reader :phone_numbers
|
47
47
|
def initialize
|
@@ -72,7 +72,7 @@ Feature: attribute of subject
|
|
72
72
|
|
73
73
|
Scenario: specify value of an attribute of a hash
|
74
74
|
Given a file named "example_spec.rb" with:
|
75
|
-
"""
|
75
|
+
"""ruby
|
76
76
|
describe Hash do
|
77
77
|
context "with two items" do
|
78
78
|
subject do
|
@@ -88,7 +88,7 @@ Feature: attribute of subject
|
|
88
88
|
|
89
89
|
Scenario: specify value for key in a hash
|
90
90
|
Given a file named "example_spec.rb" with:
|
91
|
-
"""
|
91
|
+
"""ruby
|
92
92
|
describe Hash do
|
93
93
|
context "with keys :one and 'two'" do
|
94
94
|
subject do
|
@@ -105,7 +105,7 @@ Feature: attribute of subject
|
|
105
105
|
|
106
106
|
Scenario: specify value for key in a hash-like object
|
107
107
|
Given a file named "example_spec.rb" with:
|
108
|
-
"""
|
108
|
+
"""ruby
|
109
109
|
require 'matrix'
|
110
110
|
|
111
111
|
describe Matrix do
|
@@ -9,7 +9,7 @@ Feature: explicit subject
|
|
9
9
|
|
10
10
|
Scenario: subject in top level group
|
11
11
|
Given a file named "top_level_subject_spec.rb" with:
|
12
|
-
"""
|
12
|
+
"""ruby
|
13
13
|
describe Array, "with some elements" do
|
14
14
|
subject { [1,2,3] }
|
15
15
|
it "should have the prescribed elements" do
|
@@ -22,7 +22,7 @@ Feature: explicit subject
|
|
22
22
|
|
23
23
|
Scenario: subject in a nested group
|
24
24
|
Given a file named "nested_subject_spec.rb" with:
|
25
|
-
"""
|
25
|
+
"""ruby
|
26
26
|
describe Array do
|
27
27
|
subject { [1,2,3] }
|
28
28
|
describe "with some elements" do
|
@@ -37,7 +37,7 @@ Feature: explicit subject
|
|
37
37
|
|
38
38
|
Scenario: access subject from before block
|
39
39
|
Given a file named "top_level_subject_spec.rb" with:
|
40
|
-
"""
|
40
|
+
"""ruby
|
41
41
|
describe Array, "with some elements" do
|
42
42
|
subject { [] }
|
43
43
|
before { subject.push(1,2,3) }
|
@@ -51,7 +51,7 @@ Feature: explicit subject
|
|
51
51
|
|
52
52
|
Scenario: invoke helper method from subject block
|
53
53
|
Given a file named "helper_subject_spec.rb" with:
|
54
|
-
"""
|
54
|
+
"""ruby
|
55
55
|
describe Array do
|
56
56
|
def prepared_array; [1,2,3] end
|
57
57
|
subject { prepared_array }
|
@@ -67,7 +67,7 @@ Feature: explicit subject
|
|
67
67
|
|
68
68
|
Scenario: subject block is invoked at most once per example
|
69
69
|
Given a file named "nil_subject_spec.rb" with:
|
70
|
-
"""
|
70
|
+
"""ruby
|
71
71
|
describe Array do
|
72
72
|
describe "#[]" do
|
73
73
|
context "with index out of bounds" do
|
@@ -5,7 +5,7 @@ Feature: implicit receiver
|
|
5
5
|
|
6
6
|
Scenario: implicit subject
|
7
7
|
Given a file named "example_spec.rb" with:
|
8
|
-
"""
|
8
|
+
"""ruby
|
9
9
|
describe Array do
|
10
10
|
describe "when first created" do
|
11
11
|
it { should be_empty }
|
@@ -17,7 +17,7 @@ Feature: implicit receiver
|
|
17
17
|
|
18
18
|
Scenario: explicit subject
|
19
19
|
Given a file named "example_spec.rb" with:
|
20
|
-
"""
|
20
|
+
"""ruby
|
21
21
|
describe Array do
|
22
22
|
describe "with 3 items" do
|
23
23
|
subject { [1,2,3] }
|
@@ -9,7 +9,7 @@ Feature: implicitly defined subject
|
|
9
9
|
|
10
10
|
Scenario: subject exposed in top level group
|
11
11
|
Given a file named "top_level_subject_spec.rb" with:
|
12
|
-
"""
|
12
|
+
"""ruby
|
13
13
|
describe Array do
|
14
14
|
it "should be empty when first created" do
|
15
15
|
subject.should be_empty
|
@@ -21,7 +21,7 @@ Feature: implicitly defined subject
|
|
21
21
|
|
22
22
|
Scenario: subject in a nested group
|
23
23
|
Given a file named "nested_subject_spec.rb" with:
|
24
|
-
"""
|
24
|
+
"""ruby
|
25
25
|
describe Array do
|
26
26
|
describe "when first created" do
|
27
27
|
it "should be empty" do
|
@@ -35,7 +35,7 @@ Feature: implicitly defined subject
|
|
35
35
|
|
36
36
|
Scenario: subject in a nested group with a different class (outermost wins)
|
37
37
|
Given a file named "nested_subject_spec.rb" with:
|
38
|
-
"""
|
38
|
+
"""ruby
|
39
39
|
class ArrayWithOneElement < Array
|
40
40
|
def initialize(*)
|
41
41
|
super
|
data/lib/autotest/rspec2.rb
CHANGED
@@ -47,7 +47,7 @@ class Autotest::Rspec2 < Autotest
|
|
47
47
|
# Overrides Autotest's implementation to generate the rspec command to run
|
48
48
|
def make_test_cmd(files_to_test)
|
49
49
|
files_to_test.empty? ? '' :
|
50
|
-
"#{prefix}#{ruby}#{suffix} -S '#{RSPEC_EXECUTABLE}' --tty #{normalize(files_to_test).keys.flatten.map { |f| "'#{f}'"}.join(' ')}"
|
50
|
+
"#{prefix}'#{ruby}'#{suffix} -S '#{RSPEC_EXECUTABLE}' --tty #{normalize(files_to_test).keys.flatten.map { |f| "'#{f}'"}.join(' ')}"
|
51
51
|
end
|
52
52
|
|
53
53
|
# Generates a map of filenames to Arrays for Autotest
|
data/lib/rspec/core.rb
CHANGED
@@ -1,43 +1,45 @@
|
|
1
|
-
if defined?(require_relative)
|
2
|
-
|
3
|
-
def require_rspec(path)
|
1
|
+
require_rspec = if defined?(require_relative)
|
2
|
+
lambda do |path|
|
4
3
|
require_relative path
|
5
4
|
end
|
6
5
|
else
|
7
|
-
|
8
|
-
def require_rspec(path)
|
6
|
+
lambda do |path|
|
9
7
|
require "rspec/#{path}"
|
10
8
|
end
|
11
9
|
end
|
12
10
|
|
13
11
|
require 'set'
|
14
12
|
require 'rbconfig'
|
15
|
-
require_rspec
|
16
|
-
require_rspec
|
17
|
-
require_rspec
|
18
|
-
require_rspec
|
19
|
-
require_rspec
|
20
|
-
require_rspec
|
21
|
-
require_rspec
|
22
|
-
|
23
|
-
require_rspec
|
24
|
-
require_rspec
|
25
|
-
|
26
|
-
require_rspec
|
27
|
-
require_rspec
|
28
|
-
require_rspec
|
29
|
-
|
30
|
-
require_rspec
|
31
|
-
require_rspec
|
32
|
-
require_rspec
|
33
|
-
|
34
|
-
require_rspec
|
35
|
-
require_rspec
|
36
|
-
require_rspec
|
37
|
-
require_rspec
|
38
|
-
require_rspec
|
39
|
-
require_rspec
|
40
|
-
require_rspec
|
13
|
+
require_rspec['core/filter_manager']
|
14
|
+
require_rspec['core/dsl']
|
15
|
+
require_rspec['core/extensions/kernel']
|
16
|
+
require_rspec['core/extensions/instance_eval_with_args']
|
17
|
+
require_rspec['core/extensions/module_eval_with_args']
|
18
|
+
require_rspec['core/extensions/ordered']
|
19
|
+
require_rspec['core/load_path']
|
20
|
+
require_rspec['core/deprecation']
|
21
|
+
require_rspec['core/backward_compatibility']
|
22
|
+
require_rspec['core/reporter']
|
23
|
+
|
24
|
+
require_rspec['core/metadata_hash_builder']
|
25
|
+
require_rspec['core/hooks']
|
26
|
+
require_rspec['core/subject']
|
27
|
+
require_rspec['core/let']
|
28
|
+
require_rspec['core/metadata']
|
29
|
+
require_rspec['core/pending']
|
30
|
+
require_rspec['core/formatters']
|
31
|
+
|
32
|
+
require_rspec['core/world']
|
33
|
+
require_rspec['core/configuration']
|
34
|
+
require_rspec['core/project_initializer']
|
35
|
+
require_rspec['core/option_parser']
|
36
|
+
require_rspec['core/configuration_options']
|
37
|
+
require_rspec['core/command_line']
|
38
|
+
require_rspec['core/runner']
|
39
|
+
require_rspec['core/example']
|
40
|
+
require_rspec['core/shared_example_group']
|
41
|
+
require_rspec['core/example_group']
|
42
|
+
require_rspec['core/version']
|
41
43
|
|
42
44
|
module RSpec
|
43
45
|
autoload :SharedContext, 'rspec/core/shared_context'
|
@@ -77,6 +79,20 @@ module RSpec
|
|
77
79
|
# @see RSpec.configure
|
78
80
|
# @see Core::Configuration
|
79
81
|
def self.configuration
|
82
|
+
if block_given?
|
83
|
+
RSpec.warn_deprecation <<-WARNING
|
84
|
+
|
85
|
+
*****************************************************************
|
86
|
+
DEPRECATION WARNING
|
87
|
+
|
88
|
+
* RSpec.configuration with a block is deprecated and has no effect.
|
89
|
+
* please use RSpec.configure with a block instead.
|
90
|
+
|
91
|
+
Called from #{caller(0)[1]}
|
92
|
+
*****************************************************************
|
93
|
+
|
94
|
+
WARNING
|
95
|
+
end
|
80
96
|
@configuration ||= RSpec::Core::Configuration.new
|
81
97
|
end
|
82
98
|
|
@@ -104,6 +120,11 @@ module RSpec
|
|
104
120
|
end
|
105
121
|
|
106
122
|
module Core
|
123
|
+
# @private
|
124
|
+
# This avoids issues with reporting time caused by examples that
|
125
|
+
# change the value/meaning of Time.now without properly restoring
|
126
|
+
# it.
|
127
|
+
Time = ::Time.dup
|
107
128
|
end
|
108
129
|
|
109
130
|
def self.const_missing(name)
|
@@ -123,4 +144,4 @@ module RSpec
|
|
123
144
|
end
|
124
145
|
end
|
125
146
|
|
126
|
-
require_rspec
|
147
|
+
require_rspec['core/backward_compatibility']
|