Last active
August 29, 2015 14:25
-
-
Save christemple/7541dfe54abfda95913e 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
module Simulado | |
SIMULADO = Net::HTTP.new('localhost', 7001) | |
JSON_HEADERS = {'Content-Type' => 'application/json', 'Accept' => 'application/json'} | |
def mock(response) | |
SIMULADO.post('/syncMock', response.to_json, JSON_HEADERS) | |
end | |
def last_request(method, path) | |
headers = JSON_HEADERS.merge('method' => method, 'path' => path) | |
response = SIMULADO.get('/lastRequest', headers).body | |
JSON.parse(response) | |
end | |
end | |
World(Simulado) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment