Sha256: 5201170fdbda6510f096ef75e8f6098039e45aa3e9f7946200e94ae1cd73d199
Contents?: true
Size: 487 Bytes
Versions: 28
Compression:
Stored size: 487 Bytes
Contents
require 'spec_helper' module GoTransverseTractApi RSpec.describe ApiData do before(:each) { http_auth } describe ".compact" do it "returns a hash by eliminating all nil" do given_hash = {a: {}, c: 'p', s: nil, d: {e: nil, m: nil}, f: {g: {}, x: {n: 'h', i: nil, j: 'l'}}} expected_hash = {:a=>{}, :c=>"p", :f=>{:g=>{}, :x=>{:n=>"h", :j=>"l"}}} expect(described_class.new.compact(given_hash)).to eq(expected_hash) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems