Created
October 25, 2017 02:38
-
-
Save caalberts/711e19f5afb6950bb39b5b47e55c861f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'service object' do | |
let(:data) { { a: 1, b: 2 } } | |
let(:dependency) { double() } | |
before do | |
allow(dependency).to receive(:call).and_return(data) | |
end | |
it 'wraps data from dependency into a hash' do | |
result = Service.new(dependency).exec() | |
expect(result[:success]).to be(true) | |
expect(result[:data]).to eql(data) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment