Sha256: db3f747ed4b3afbe406300a62522b37131af134d8dc1fcd020698ca10ffb0483
Contents?: true
Size: 791 Bytes
Versions: 21
Compression:
Stored size: 791 Bytes
Contents
shared_examples_for 'a command' do describe '#name' do it 'returns relation name' do expect(command.name).to eql(command.relation.name) end end describe '#gateway' do it 'returns relation gateway' do expect(command.gateway).to eql(command.relation.gateway) end end describe '#method_missing' do it 'forwards to relation and wraps response if it returned another relation' do if command.class.restrictable new_command = command.by_id(1) expect(new_command).to be_instance_of(command.class) expect(new_command.relation).to eql(command.by_id(1).relation) end end it 'raises error when message is not known' do expect { command.not_here }.to raise_error(NoMethodError, /not_here/) end end end
Version data entries
21 entries across 21 versions & 1 rubygems