Sha256: 7b631403c7d1e2c463b27ce58bde042dd0ffab3f4724480cf555ecd76f1bb4c5

Contents?: true

Size: 1.63 KB

Versions: 8

Compression:

Stored size: 1.63 KB

Contents

require "spec_helper"

describe "deprecations" do
  describe "Spec" do
    it "is deprecated" do
      RSpec.should_receive(:warn_deprecation).with(/Spec .* RSpec/i)
      Spec
    end

    it "returns RSpec" do
      RSpec.stub(:warn_deprecation)
      Spec.should == RSpec
    end

    it "doesn't include backward compatibility in const_missing backtrace" do
      RSpec.stub(:warn_deprecation)
      exception = nil
      begin
        ConstantThatDoesNotExist
      rescue Exception => exception
      end
      exception.backtrace.find { |l| l =~ /lib\/rspec\/core\/backward_compatibility/ }.should be_nil
    end
  end

  describe RSpec::Core::ExampleGroup do
    describe 'running_example' do
      it 'is deprecated' do
        RSpec.should_receive(:warn_deprecation)
        self.running_example
      end

      it "delegates to example" do
        RSpec.stub(:warn_deprecation)
        running_example.should == example
      end
    end
  end

  describe "Spec::Runner.configure" do
    it "is deprecated" do
      RSpec.stub(:warn_deprecation)
      RSpec.should_receive(:deprecate)
      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

    it "doesn't include backward compatibility in const_missing backtrace" do
      RSpec.stub(:warn_deprecation)
      exception = nil
      begin
        Spec::Rake::ConstantThatDoesNotExist
      rescue Exception => exception
      end
      exception.backtrace.find { |l| l =~ /lib\/rspec\/core\/backward_compatibility/ }.should be_nil
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-core-2.6.4 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.3 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.3.beta1 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.2.rc spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.0 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.0.rc6 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.0.rc4 spec/rspec/core/deprecations_spec.rb
rspec-core-2.6.0.rc2 spec/rspec/core/deprecations_spec.rb