Sha256: dd38bf11bd45672b392f1bc0c1b48fa679927e21378e3c39f9cb7a1cddc2218e

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

shared_examples_for 'a command' do
  describe '#method_missing' do
    it 'forwards to relation and wraps response if it returned another relation' do
      new_command = command.with_params(1)

      expect(new_command).to be_instance_of(command.class)
      expect(new_command.relation).to eq(command.with_params(1).relation)
    end

    it 'returns original response if it was not a relation' do
      expect(command.name).to eq(command.relation.name)
    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

2 entries across 2 versions & 1 rubygems

Version Path
rom-http-0.1.0 spec/shared/command_behaviour.rb
rom-http-0.0.1 spec/shared/command_behaviour.rb