Sha256: e5ee81c42edee44bdaf5163fda14bd4a639c2047cdac72434affbcf8b4ccf864
Contents?: true
Size: 678 Bytes
Versions: 43
Compression:
Stored size: 678 Bytes
Contents
require 'rails_helper' describe LHC do context 'data accessor (hash with indifferent access)' do before(:each) do stub_request(:get, "http://local.ch/") .with(headers: { 'Accept' => 'application/json', 'Content-Type' => 'application/json' }) .to_return(body: { 'MyProp' => 'MyValue' }.to_json) end it 'makes data accessible with square bracket accessor (string)' do expect( LHC.json.get('http://local.ch')['MyProp'] ).to eq 'MyValue' end it 'makes data accessible with square bracket accessor (symbol)' do expect( LHC.json.get('http://local.ch')[:MyProp] ).to eq 'MyValue' end end end
Version data entries
43 entries across 43 versions & 1 rubygems