Class: Mocktail::EnsuresImitationSupport

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/imitates_type/ensures_imitation_support.rb,
lib/mocktail/sorbet/mocktail/imitates_type/ensures_imitation_support.rb

Instance Method Summary collapse

Instance Method Details

#ensure(type) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/mocktail/imitates_type/ensures_imitation_support.rb', line 5

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