lib/minitest_to_rspec/rspec/stub.rb
# Returns a Sexp representing an RSpec stub (allow) or message
# expectation (expect)
Returns a Sexp representing an RSpec stub (allow) or message
expectation (expect)
Returns a Sexp representing an RSpec stub ( allow ) or message expectation ( expect )
def to_rspec_exp
        stub_chain = s(:call, nil, :receive, @message)
        unless @with.nil?
          stub_chain = s(:call, stub_chain, :with, @with)
        end
        unless @returns.nil?
          stub_chain = s(:call, stub_chain, :and_return, @returns)
        end
        unless @count.nil?
          stub_chain = s(:call, stub_chain, receive_count_method)
        end
        expect_allow = s(:call, nil, rspec_mocks_method, @receiver.dup)
        s(:call, expect_allow, :to, stub_chain)
      end
def to_rspec_exp stub_chain = s ( :call , nil , :receive , @message ) unless @with . nil? stub_chain = s ( :call , stub_chain , :with , @with ) end unless @returns . nil? stub_chain = s ( :call , stub_chain , :and_return , @returns ) end unless @count . nil? stub_chain = s ( :call , stub_chain , receive_count_method ) end expect_allow = s ( :call , nil , rspec_mocks_method , @receiver . dup ) s ( :call , expect_allow , :to , stub_chain ) end
Returns a Sexp representing an RSpec stub (allow) or message
expectation (expect)
Returns a Sexp representing an RSpec stub ( allow ) or message expectation ( expect )