title: How to stub method in initialize with rspec
body: <pre><code>class Party
      attr_accessor :number
    include Validations
  
      def initialize
          self.number = proccess_args(2)
          puts luhn?
      end
  
      def proccess_args(opt)
          ARGV[opt].downcase
      end
  end
  </code></pre>
  
  <p>require 'spec_helper'</p>
  
  <pre><code>describe Party do
    before :each do
  
      new_method = Party.method(:new)
      allow(self).to receive(proccess_args).with(2).and_return('add')
      @party = Party.new 
    end
  end
  </code></pre>
  
  <p>spec_helper.rb
      require_relative '../'</p>
  
  <pre><code>require 'yaml'
  </code></pre>
  
  <p>How can I use rspec, to ensure proccess_args is not actually called, but is simulated in order to avoid ARGV from blowing up my tests? For example I would like to fake the call of proccess_args(2) to return "Jason Wade", and avoid ARGV[opt] from ever being touched by rspec. </p>