Sha256: de9edfed7caf1315b221396f4417aa09d3385a171b3c506e2addfa67b2fe1a0f

Contents?: true

Size: 393 Bytes

Versions: 7

Compression:

Stored size: 393 Bytes

Contents

module FactoryBot
  class Decorator
    class InvocationTracker < Decorator
      def initialize(component)
        super
        @invoked_methods = []
      end

      def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissing
        @invoked_methods << name
        super
      end

      def __invoked_methods__
        @invoked_methods.uniq
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
factory_bot-5.1.1 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.1.0 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.0.2 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.0.1 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.0.0 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.0.0.rc2 lib/factory_bot/decorator/invocation_tracker.rb
factory_bot-5.0.0.rc1 lib/factory_bot/decorator/invocation_tracker.rb