Last active
August 26, 2016 10:06
-
-
Save elmendalerenda/c66e8131c4195a48c68835d024942b88 to your computer and use it in GitHub Desktop.
minitest sample for medium article
This file contains hidden or 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
def test_calls_remote_service | |
remote_services = Minitest::Mock.new | |
voice_service = VoiceService.new(remote_services) | |
remote_services.expect :request_recognize, { result: 'ochenta y ocho' }.to_json, ['88.wav'] | |
result = voice_service.recognize('88.wav') | |
assert_equal 'ochenta y ocho', result | |
remote_services.verify | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment