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
require 'spec_helper' | |
require 'rest-client' | |
describe WebMock::API do | |
describe '#stub_request with hash_including' do | |
context "when setting 'hash_including' with an hash" do | |
before do | |
WebMock::API.stub_request(:post, 'www.example.com'). |
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
class HashKeysStringifier | |
def self.stringify_keys!(arg) | |
case arg | |
when Array | |
arg.map { |elem| stringify_keys!(elem) } | |
when Hash | |
Hash[ | |
*arg.map { |key, value| | |
k = key.is_a?(Symbol) ? key.to_s : key |