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.
Files changed (116) hide show
  1. data/Changelog.md +59 -0
  2. data/README.md +22 -0
  3. data/features/command_line/example_name_option.feature +5 -5
  4. data/features/command_line/exit_status.feature +6 -6
  5. data/features/command_line/format_option.feature +2 -2
  6. data/features/command_line/line_number_appended_to_path.feature +2 -2
  7. data/features/command_line/line_number_option.feature +2 -2
  8. data/features/command_line/pattern_option.feature +2 -2
  9. data/features/command_line/rake_task.feature +62 -8
  10. data/features/command_line/ruby.feature +1 -1
  11. data/features/command_line/tag.feature +1 -1
  12. data/features/configuration/alias_example_to.feature +2 -2
  13. data/features/configuration/custom_settings.feature +3 -3
  14. data/features/configuration/default_path.feature +3 -3
  15. data/features/configuration/fail_fast.feature +5 -5
  16. data/features/configuration/read_options_from_file.feature +4 -4
  17. data/features/example_groups/basic_structure.feature +2 -2
  18. data/features/example_groups/shared_context.feature +3 -3
  19. data/features/example_groups/shared_examples.feature +25 -7
  20. data/features/expectation_framework_integration/configure_expectation_framework.feature +6 -6
  21. data/features/filtering/exclusion_filters.feature +5 -5
  22. data/features/filtering/if_and_unless.feature +5 -5
  23. data/features/filtering/inclusion_filters.feature +5 -5
  24. data/features/filtering/run_all_when_everything_filtered.feature +3 -3
  25. data/features/formatters/custom_formatter.feature +2 -2
  26. data/features/formatters/json_formatter.feature +30 -0
  27. data/features/formatters/text_formatter.feature +5 -5
  28. data/features/helper_methods/arbitrary_methods.feature +2 -2
  29. data/features/helper_methods/let.feature +2 -2
  30. data/features/helper_methods/modules.feature +6 -6
  31. data/features/hooks/around_hooks.feature +11 -11
  32. data/features/hooks/before_and_after_hooks.feature +15 -11
  33. data/features/hooks/filtering.feature +6 -6
  34. data/features/metadata/current_example.feature +1 -1
  35. data/features/metadata/described_class.feature +1 -1
  36. data/features/metadata/user_defined.feature +4 -4
  37. data/features/mock_framework_integration/use_any_framework.feature +6 -6
  38. data/features/mock_framework_integration/use_flexmock.feature +5 -5
  39. data/features/mock_framework_integration/use_mocha.feature +5 -5
  40. data/features/mock_framework_integration/use_rr.feature +5 -5
  41. data/features/mock_framework_integration/use_rspec.feature +5 -5
  42. data/features/pending/pending_examples.feature +11 -11
  43. data/features/spec_files/arbitrary_file_suffix.feature +1 -1
  44. data/features/step_definitions/additional_cli_steps.rb +2 -0
  45. data/features/subject/attribute_of_subject.feature +5 -5
  46. data/features/subject/explicit_subject.feature +5 -5
  47. data/features/subject/implicit_receiver.feature +2 -2
  48. data/features/subject/implicit_subject.feature +3 -3
  49. data/lib/autotest/rspec2.rb +1 -1
  50. data/lib/rspec/core.rb +53 -32
  51. data/lib/rspec/core/configuration.rb +123 -15
  52. data/lib/rspec/core/configuration_options.rb +17 -2
  53. data/lib/rspec/core/example.rb +5 -4
  54. data/lib/rspec/core/example_group.rb +19 -9
  55. data/lib/rspec/core/extensions/ordered.rb +12 -6
  56. data/lib/rspec/core/formatters.rb +55 -0
  57. data/lib/rspec/core/formatters/base_formatter.rb +43 -38
  58. data/lib/rspec/core/formatters/base_text_formatter.rb +9 -5
  59. data/lib/rspec/core/formatters/documentation_formatter.rb +1 -1
  60. data/lib/rspec/core/formatters/helpers.rb +30 -5
  61. data/lib/rspec/core/formatters/html_formatter.rb +58 -368
  62. data/lib/rspec/core/formatters/html_printer.rb +407 -0
  63. data/lib/rspec/core/formatters/json_formatter.rb +73 -0
  64. data/lib/rspec/core/formatters/snippet_extractor.rb +3 -1
  65. data/lib/rspec/core/hooks.rb +4 -4
  66. data/lib/rspec/core/metadata.rb +14 -6
  67. data/lib/rspec/core/mocking/with_mocha.rb +25 -2
  68. data/lib/rspec/core/mocking/with_rspec.rb +6 -2
  69. data/lib/rspec/core/option_parser.rb +28 -7
  70. data/lib/rspec/core/project_initializer.rb +0 -1
  71. data/lib/rspec/core/rake_task.rb +49 -38
  72. data/lib/rspec/core/reporter.rb +2 -2
  73. data/lib/rspec/core/shared_example_group.rb +89 -41
  74. data/lib/rspec/core/subject.rb +6 -2
  75. data/lib/rspec/core/version.rb +1 -1
  76. data/lib/rspec/core/world.rb +2 -2
  77. data/spec/autotest/rspec_spec.rb +6 -1
  78. data/spec/command_line/order_spec.rb +67 -0
  79. data/spec/rspec/core/configuration_options_spec.rb +45 -38
  80. data/spec/rspec/core/configuration_spec.rb +219 -44
  81. data/spec/rspec/core/deprecations_spec.rb +9 -0
  82. data/spec/rspec/core/drb_command_line_spec.rb +1 -7
  83. data/spec/rspec/core/drb_options_spec.rb +1 -1
  84. data/spec/rspec/core/dsl_spec.rb +17 -9
  85. data/spec/rspec/core/example_group_spec.rb +51 -5
  86. data/spec/rspec/core/example_spec.rb +39 -7
  87. data/spec/rspec/core/filter_manager_spec.rb +20 -30
  88. data/spec/rspec/core/formatters/base_formatter_spec.rb +29 -1
  89. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +6 -2
  90. data/spec/rspec/core/formatters/helpers_spec.rb +12 -0
  91. data/spec/rspec/core/formatters/html_formatted-1.8.7-rbx.html +462 -0
  92. data/spec/rspec/core/formatters/html_formatted-1.9.2-jruby.html +410 -0
  93. data/spec/rspec/core/formatters/html_formatted-1.9.3-rbx.html +462 -0
  94. data/spec/rspec/core/formatters/html_formatter_spec.rb +11 -3
  95. data/spec/rspec/core/formatters/json_formatter_spec.rb +110 -0
  96. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +8 -0
  97. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-rbx.html +462 -0
  98. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2-jruby.html +410 -0
  99. data/spec/rspec/core/formatters/text_mate_formatted-1.9.3-rbx.html +462 -0
  100. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +11 -3
  101. data/spec/rspec/core/hooks_filtering_spec.rb +6 -6
  102. data/spec/rspec/core/metadata_spec.rb +29 -0
  103. data/spec/rspec/core/option_parser_spec.rb +42 -0
  104. data/spec/rspec/core/project_initializer_spec.rb +2 -2
  105. data/spec/rspec/core/rake_task_spec.rb +60 -17
  106. data/spec/rspec/core/reporter_spec.rb +17 -0
  107. data/spec/rspec/core/runner_spec.rb +1 -0
  108. data/spec/rspec/core/shared_example_group_spec.rb +17 -5
  109. data/spec/rspec/core/subject_spec.rb +11 -0
  110. data/spec/spec_helper.rb +32 -2
  111. data/spec/support/config_options_helper.rb +1 -10
  112. data/spec/support/helper_methods.rb +13 -0
  113. data/spec/support/isolated_directory.rb +10 -0
  114. data/spec/support/isolated_home_directory.rb +16 -0
  115. metadata +145 -148
  116. 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 arbitary reason, with no block
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 arbitary reason, with a block that fails
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 arbitary reason, with a block that passes
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
 
@@ -2,7 +2,7 @@ Feature: arbitrary file suffix
2
2
 
3
3
  Scenario: .spec
4
4
  Given a file named "a.spec" with:
5
- """
5
+ """ruby
6
6
  describe "something" do
7
7
  it "does something" do
8
8
  3.should eq(3)
@@ -1,3 +1,5 @@
1
+ require 'rspec/core' # to fix annoying "undefined method `configuration' for RSpec:Module (NoMethodError)"
2
+
1
3
  Then /^the output should contain all of these:$/ do |table|
2
4
  table.raw.flatten.each do |string|
3
5
  assert_partial_output(string, all_output)
@@ -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
@@ -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
@@ -1,43 +1,45 @@
1
- if defined?(require_relative)
2
- # @private
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
- # @private
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 'core/filter_manager'
16
- require_rspec 'core/dsl'
17
- require_rspec 'core/extensions'
18
- require_rspec 'core/load_path'
19
- require_rspec 'core/deprecation'
20
- require_rspec 'core/backward_compatibility'
21
- require_rspec 'core/reporter'
22
-
23
- require_rspec 'core/metadata_hash_builder'
24
- require_rspec 'core/hooks'
25
- require_rspec 'core/subject'
26
- require_rspec 'core/let'
27
- require_rspec 'core/metadata'
28
- require_rspec 'core/pending'
29
-
30
- require_rspec 'core/world'
31
- require_rspec 'core/configuration'
32
- require_rspec 'core/project_initializer'
33
- require_rspec 'core/option_parser'
34
- require_rspec 'core/configuration_options'
35
- require_rspec 'core/command_line'
36
- require_rspec 'core/runner'
37
- require_rspec 'core/example'
38
- require_rspec 'core/shared_example_group'
39
- require_rspec 'core/example_group'
40
- require_rspec 'core/version'
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 'core/backward_compatibility'
147
+ require_rspec['core/backward_compatibility']