Sha256: 5540a600f4c5ab49f366d7f961dfd03b45ae1728bcb3e582791572bfc6b86f09

Contents?: true

Size: 511 Bytes

Versions: 15

Compression:

Stored size: 511 Bytes

Contents

require_relative "imitates_type/ensures_imitation_support"
require_relative "imitates_type/makes_double"

module Mocktail
  class ImitatesType
    def initialize
      @top_shelf = TopShelf.instance
      @ensures_imitation_support = EnsuresImitationSupport.new
      @makes_double = MakesDouble.new
    end

    def imitate(type)
      @ensures_imitation_support.ensure(type)
      @makes_double.make(type).tap do |double|
        Mocktail.cabinet.store_double(double)
      end.dry_instance
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mocktail-1.2.3 lib/mocktail/imitates_type.rb
mocktail-1.2.2 lib/mocktail/imitates_type.rb
mocktail-1.2.1 lib/mocktail/imitates_type.rb
mocktail-1.2.0 lib/mocktail/imitates_type.rb
mocktail-1.1.3 lib/mocktail/imitates_type.rb
mocktail-1.1.2 lib/mocktail/imitates_type.rb
mocktail-1.1.1 lib/mocktail/imitates_type.rb
mocktail-1.1.0 lib/mocktail/imitates_type.rb
mocktail-1.0.0 lib/mocktail/imitates_type.rb
mocktail-0.0.6 lib/mocktail/imitates_type.rb
mocktail-0.0.5 lib/mocktail/imitates_type.rb
mocktail-0.0.4 lib/mocktail/imitates_type.rb
mocktail-0.0.3 lib/mocktail/imitates_type.rb
mocktail-0.0.2 lib/mocktail/imitates_type.rb
mocktail-0.0.1 lib/mocktail/imitates_type.rb