spec/support/examples.rb in ruby_rabbitmq_janus-1.1.12 vs spec/support/examples.rb in ruby_rabbitmq_janus-1.2.0
- old
+ new
@@ -34,25 +34,24 @@
end
end
# Handle request
shared_examples 'message_handle should match json schema' do
- let(:replace) { replace }
- let(:add) { add }
- let(:message) { @gateway.message_handle(@type, replace, add) }
+ let(:message) { @gateway.message_handle(@type, @options) }
it do
@gateway.start_handle(true) do
expect(message.to_json).to match_json_schema(@type)
end
end
end
shared_examples 'message_handle should match json empty' do
- let(:replace) { replace }
- let(:add) { add }
- let(:message) { @gateway.message_handle(@type, replace, add) }
+ let(:message) do
+ options = options.nil? ? { replace: {}, add: {} } : options
+ @gateway.message_handle(@type, options)
+ end
it do
@gateway.start_handle(false) do
expect(message.to_json).to eq('{}')
end
@@ -60,12 +59,10 @@
end
# Handle admin
shared_examples 'message_handle_admin should match json schema' do
let(:message) do
- @gateway.start_handle_admin do
- @gateway.message_handle(@type)
- end
+ @gateway.message_admin(@type)
end
it do
expect(message.to_json).to match_json_schema(@type)
end