Sha256: b00b62cffac4dc1c5adc4a6f98820f031bdb458065ecd3e73f7d45d85f240bc0

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

# typed: strict

module Mocktail
  class EnsuresImitationSupport
    extend T::Sig

    sig { params(type: T.any(T::Class[T.anything], Module)).void }
    def ensure(type)
      unless type.is_a?(Class) || type.is_a?(Module)
        raise UnsupportedMocktail.new <<~MSG.tr("\n", " ")
          Mocktail.of() can only mix mocktail instances of modules and classes.
        MSG
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocktail-2.0.0 lib/mocktail/sorbet/mocktail/imitates_type/ensures_imitation_support.rb