lib/rspec/arguments/monkey_patcher.rb
def subject
        __memoized.fetch_or_store(:subject) do
          metadata = self.class.metadata
          described = described_class || metadata.fetch(:description_args).first

          if described.is_a?(Class)
            if metadata[:rspec_arguments] || metadata[:method] || metadata[:class_method]
              process_subject(described)
            else
              described.new
            end
          else
            described
          end
        end
      end
#
# The only monkey-patching in this gem.
#
# Mostly untouched, except we call
# `process_subject`, instead of simply
# instantiating the described_class.
#
The only monkey-patching in this gem.
Mostly untouched, except we call
`process_subject`, instead of simply
instantiating the described_class.
The only monkey - patching in this gem . Mostly untouched except we call ` process_subject ` instead of simply instantiating the described_class .
def subject
        __memoized.fetch_or_store(:subject) do
          metadata = self.class.metadata
          described = described_class || metadata.fetch(:description_args).first
          if described.is_a?(Class)
            if metadata[:rspec_arguments] || metadata[:method] || metadata[:class_method]
              process_subject(described)
            else
              described.new
            end
          else
            described
          end
        end
      end
def subject __memoized . fetch_or_store ( :subject ) do metadata = self . class . metadata described = described_class || metadata . fetch ( :description_args ) . first if described . is_a? ( Class ) if metadata [ :rspec_arguments ] || metadata [ :method ] || metadata [ :class_method ] process_subject ( described ) else described . new end else described end end end
The only monkey-patching in this gem.
The only monkey - patching in this gem .