Sha256: 799c2648c319ddfb4e73a39c9ad2a77f949abdd37689a98a0ac0d058e0cfc829

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

class FilmSnob
  describe Deprecated do

    class Dog
      extend Deprecated

      deprecated_alias :woof, :bark, removed_in: "v4.0.0"

      def bark
        "bark"
      end
    end

    let(:milo) { Dog.new }

    describe "deprecated_alias" do
      it "does not interfere with the current method" do
        expect(Kernel).to_not receive(:warn)
        milo.bark
      end

      it "creates an alias" do
        expect(milo).to respond_to :woof
        expect(Kernel).to receive(:warn)
        expect(milo.woof).to eq "bark"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
film_snob-0.6.2 spec/deprecated_spec.rb
film_snob-0.6.1 spec/deprecated_spec.rb
film_snob-0.6.0 spec/deprecated_spec.rb
film_snob-0.5.0 spec/deprecated_spec.rb