Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deprecation warning for Rspec and Spec

  • Loading branch information...
commit 164224a01586e99cf76c73995018a9ae040c853c 1 parent 2d18c1e
@dchelimsky dchelimsky authored
View
8 lib/rspec/core/backward_compatibility.rb
@@ -9,15 +9,13 @@ def mock_with(use_me_to_mock)
module ConstMissing
def const_missing(name)
case name
- when :Rspec
- RSpec
- when :Spec
- RSpec.warn <<-WARNING
+ when :Rspec, :Spec
+ RSpec.warn_deprecation <<-WARNING
*****************************************************************
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
-* Spec is deprecated.
+* #{name} is deprecated.
* RSpec is the new top-level module in RSpec-2
#{caller(0)[1]}
View
7 lib/rspec/core/deprecation.rb
@@ -21,13 +21,12 @@ def deprecate(method, alternate_method=nil, version=nil)
end
message << "*****************************************************************"
- warn(message)
+ warn_deprecation(message)
end
- def warn(message)
- Kernel.warn(message)
+ def warn_deprecation(message)
+ send :warn, message
end
-
end
class HashWithDeprecationNotice < Hash
View
59 rspec-core.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Chad Humphries", "David Chelimsky"]
- s.date = %q{2010-06-01}
+ s.date = %q{2010-06-02}
s.description = %q{RSpec runner and example group classes}
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
s.executables = ["rspec", "spec"]
@@ -31,54 +31,6 @@ Gem::Specification.new do |s|
"bin/rspec",
"bin/spec",
"cucumber.yml",
- "example_specs/failing/README.txt",
- "example_specs/failing/diffing_spec.rb",
- "example_specs/failing/failing_implicit_docstrings_example.rb",
- "example_specs/failing/failure_in_after.rb",
- "example_specs/failing/failure_in_before.rb",
- "example_specs/failing/mocking_example.rb",
- "example_specs/failing/mocking_with_flexmock.rb",
- "example_specs/failing/mocking_with_mocha.rb",
- "example_specs/failing/mocking_with_rr.rb",
- "example_specs/failing/partial_mock_example.rb",
- "example_specs/failing/pending_example.rb",
- "example_specs/failing/predicate_example.rb",
- "example_specs/failing/raising_example.rb",
- "example_specs/failing/spec_helper.rb",
- "example_specs/failing/syntax_error_example.rb",
- "example_specs/failing/team_spec.rb",
- "example_specs/failing/timeout_behaviour.rb",
- "example_specs/passing/custom_formatter.rb",
- "example_specs/passing/custom_matchers.rb",
- "example_specs/passing/dynamic_spec.rb",
- "example_specs/passing/file_accessor.rb",
- "example_specs/passing/file_accessor_spec.rb",
- "example_specs/passing/filtered_formatter.rb",
- "example_specs/passing/filtered_formatter_example.rb",
- "example_specs/passing/greeter_spec.rb",
- "example_specs/passing/helper_method_example.rb",
- "example_specs/passing/implicit_docstrings_example.rb",
- "example_specs/passing/io_processor.rb",
- "example_specs/passing/io_processor_spec.rb",
- "example_specs/passing/mocking_example.rb",
- "example_specs/passing/multi_threaded_example_group_runner.rb",
- "example_specs/passing/nested_classes_example.rb",
- "example_specs/passing/options_example.rb",
- "example_specs/passing/options_formatter.rb",
- "example_specs/passing/partial_mock_example.rb",
- "example_specs/passing/pending_example.rb",
- "example_specs/passing/predicate_example.rb",
- "example_specs/passing/shared_example_group_example.rb",
- "example_specs/passing/shared_stack_examples.rb",
- "example_specs/passing/spec_helper.rb",
- "example_specs/passing/stack.rb",
- "example_specs/passing/stack_spec.rb",
- "example_specs/passing/stack_spec_with_nested_example_groups.rb",
- "example_specs/passing/stubbing_example.rb",
- "example_specs/passing/subject_example.rb",
- "example_specs/passing/yielding_example.rb",
- "example_specs/ruby1.9.compatibility/access_to_constants_spec.rb",
- "example_specs/spec_helper.rb",
"features/command_line/example_name_option.feature",
"features/command_line/line_number_appended_to_path.feature",
"features/command_line/line_number_option.feature",
@@ -105,10 +57,11 @@ Gem::Specification.new do |s|
"lib/rspec/core.rb",
"lib/rspec/core/around_proxy.rb",
"lib/rspec/core/backward_compatibility.rb",
- "lib/rspec/core/command_line_options.rb",
+ "lib/rspec/core/command_line.rb",
"lib/rspec/core/configuration.rb",
"lib/rspec/core/configuration_options.rb",
"lib/rspec/core/deprecation.rb",
+ "lib/rspec/core/drb_command_line.rb",
"lib/rspec/core/errors.rb",
"lib/rspec/core/example.rb",
"lib/rspec/core/example_group.rb",
@@ -147,7 +100,7 @@ Gem::Specification.new do |s|
"spec/rspec/core/configuration_options_spec.rb",
"spec/rspec/core/configuration_spec.rb",
"spec/rspec/core/deprecations_spec.rb",
- "spec/rspec/core/drb_proxy_spec.rb",
+ "spec/rspec/core/drb_command_line_spec.rb",
"spec/rspec/core/example_group_spec.rb",
"spec/rspec/core/example_spec.rb",
"spec/rspec/core/formatters/base_formatter_spec.rb",
@@ -163,7 +116,6 @@ Gem::Specification.new do |s|
"spec/rspec/core/resources/a_foo.rb",
"spec/rspec/core/resources/a_spec.rb",
"spec/rspec/core/resources/custom_example_group_runner.rb",
- "spec/rspec/core/resources/drb_example_spec.rb",
"spec/rspec/core/resources/utf8_encoded.rb",
"spec/rspec/core/ruby_project_spec.rb",
"spec/rspec/core/runner_spec.rb",
@@ -198,7 +150,7 @@ Gem::Specification.new do |s|
"spec/rspec/core/configuration_options_spec.rb",
"spec/rspec/core/configuration_spec.rb",
"spec/rspec/core/deprecations_spec.rb",
- "spec/rspec/core/drb_proxy_spec.rb",
+ "spec/rspec/core/drb_command_line_spec.rb",
"spec/rspec/core/example_group_spec.rb",
"spec/rspec/core/example_spec.rb",
"spec/rspec/core/formatters/base_formatter_spec.rb",
@@ -214,7 +166,6 @@ Gem::Specification.new do |s|
"spec/rspec/core/resources/a_foo.rb",
"spec/rspec/core/resources/a_spec.rb",
"spec/rspec/core/resources/custom_example_group_runner.rb",
- "spec/rspec/core/resources/drb_example_spec.rb",
"spec/rspec/core/resources/utf8_encoded.rb",
"spec/rspec/core/ruby_project_spec.rb",
"spec/rspec/core/runner_spec.rb",
View
2  spec/rspec/core/deprecations_spec.rb
@@ -3,7 +3,7 @@
describe "deprecations" do
describe "Spec" do
it "is deprecated" do
- RSpec.should_receive(:warn).with /Spec .* RSpec/i
+ RSpec.should_receive(:warn_deprecation).with /Spec .* RSpec/i
Spec
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.