Sha256: f4de81ed70e62217a7f7c71d47899abaa7ac40ba62820edc3c134dbcca7739be

Contents?: true

Size: 894 Bytes

Versions: 11

Compression:

Stored size: 894 Bytes

Contents

require 'spec_helper'

describe "deprecated module methods" do
  module DeprecatedModule
    extend Deprecation

    self.deprecation_behavior = :raise

    self.deprecation_horizon = 'release 0.1'
    def a

    end

    deprecation_deprecate :a
  end

  module DeprecatedModuleLater
    extend Deprecation

    self.deprecation_behavior = :raise

    self.deprecation_horizon = 'release 0.2'
    def b

    end

    deprecation_deprecate :b
  end
  class DeprecationModuleTest
    include DeprecatedModule
    include DeprecatedModuleLater
  end
  subject { DeprecationModuleTest.new}

  describe "a" do
    it "should be deprecated" do
      expect { subject.a }.to raise_error /a is deprecated/
    end
  end
  describe "b" do
    it "should be deprecated in release 0.2" do
      expect { subject.b }.to raise_error /b is deprecated and will be removed from release 0.2/
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/deprecation-1.1.0/spec/deprecated_module_spec.rb
deprecation-1.1.0 spec/deprecated_module_spec.rb
deprecation-0.99.0 spec/deprecated_module_spec.rb
deprecation-1.0.0 spec/deprecated_module_spec.rb
deprecation-0.2.2 spec/deprecated_module_spec.rb
deprecation-0.2.1 spec/deprecated_module_spec.rb
deprecation-0.2.0 spec/deprecated_module_spec.rb
deprecation-0.1.0 spec/deprecated_module_spec.rb
deprecation-0.0.5 spec/deprecated_module_spec.rb
deprecation-0.0.3 spec/deprecated_module_spec.rb
deprecation-0.0.2 spec/deprecated_module_spec.rb