Sha256: 7dd42001ef88d7c846e4ae2070b6dee9ffd57b710507b1ec1a906e81fbe8d416
Contents?: true
Size: 567 Bytes
Versions: 9
Compression:
Stored size: 567 Bytes
Contents
module RSpec module Mocks RSpec.describe 'and_return' do let(:obj) { double('obj') } context 'when a block is passed' do it 'raises ArgumentError' do expect { allow(obj).to receive(:foo).and_return('bar') { 'baz' } }.to raise_error(ArgumentError, /implementation block/i) end end context 'when no argument is passed' do it 'raises ArgumentError' do expect { allow(obj).to receive(:foo).and_return }.to raise_error(ArgumentError) end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems