example/spec/handler_spec.rb in faastruby-0.3.1 vs example/spec/handler_spec.rb in faastruby-0.3.2
- old
+ new
@@ -3,18 +3,18 @@
describe 'handler(event)' do
let(:event) {SpecHelper::Event.new(body: '{"name": "Ruby"}')}
it 'should return Hash, String or Array' do
- body = handler(event).body
+ body = handler(event).call.body
expect([String, Hash, Array].include? body.class).to be true
end
it 'should add the name to the response string' do
- body = handler(event).body
+ body = handler(event).call.body
expect(body).to be == 'Hello, Ruby!'
end
it 'should say Hello, World! when name is not present' do
event = SpecHelper::Event.new(body: nil)
- body = handler(event).body
+ body = handler(event).call.body
expect(body).to be == 'Hello, World!'
end
end