rspec/rspec-mocks

View on GitHub
lib/rspec/mocks/matchers/expectation_customization.rb

Summary

Maintainability
A
0 mins
Test Coverage
module RSpec
  module Mocks
    module Matchers
      # @private
      class ExpectationCustomization
        attr_accessor :block

        def initialize(method_name, args, block)
          @method_name = method_name
          @args        = args
          @block       = block
        end

        def playback_onto(expectation)
          expectation.__send__(@method_name, *@args, &@block)
        end
      end
    end
  end
end