Skip to content

Commit

Permalink
Add deprecated Spec::Rake::SpecTask from rspec-1 with deprecation
Browse files Browse the repository at this point in the history
warning and delegation to RSpec::Core::RakeTask
  • Loading branch information
dchelimsky committed Oct 24, 2010
1 parent 54f8e2b commit 21c0036
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/rspec/core/backward_compatibility.rb
Expand Up @@ -29,6 +29,20 @@ def self.configure(&block)
RSpec.configure(&block)
end
end

module Rake
def self.const_missing(name)
case name
when :SpecTask
RSpec.deprecate("Spec::Rake::SpecTask", "RSpec::Core::RakeTask")
require 'rspec/core/rake_task'
RSpec::Core::RakeTask
else
super(name)
end
end

end
end

Object.extend(RSpec::Core::ConstMissing)
8 changes: 8 additions & 0 deletions spec/rspec/core/deprecations_spec.rb
Expand Up @@ -34,4 +34,12 @@
Spec::Runner.configure
end
end

describe "Spec::Rake::SpecTask" do
it "is deprecated" do
RSpec.stub(:warn_deprecation)
RSpec.should_receive(:deprecate)
Spec::Rake::SpecTask
end
end
end

0 comments on commit 21c0036

Please sign in to comment.