Skip to content

Instantly share code, notes, and snippets.

@steookk
steookk / stub_hash_including_spec.rb
Created November 11, 2013 22:35
webmock 1.5.2 stub_request + hash_including spec failing
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').
@steookk
steookk / stringify_keys.rb
Last active December 27, 2015 12:09
Stringify hash keys (from bblimke / webmock)
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