#!/usr/bin/env ruby require "bundler/setup" require "mocktail" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. class Negroni def self.ingredients [:gin, :campari, :sweet_vermouth] end def shake!(shaker) shaker.mix(self.class.ingredients) end def sip(amount) raise "unimplemented" end end include Mocktail::DSL class UserRepository def find(id); end def transaction(&blk); end end class Auditor def record!(message, user:, action: nil); end end class Shaker def combine(*args); end end class Glass def pour!(drink); end end class Bar def pass(glass, to:) end end class Bartender def initialize @shaker = Shaker.new @glass = Glass.new @bar = Bar.new end def make_drink(name, customer:) if name == :negroni drink = @shaker.combine(:gin, :campari, :sweet_vermouth) @glass.pour!(drink) @bar.pass(@glass, to: customer) end end end # (If you use this, don't forget to add pry to your Gemfile!) require "pry" Pry.start