Sha256: b9d5520d61965dcdd56425f1c0ff664e405085e53f7d3f6416525d8ca58f3813
Contents?: true
Size: 758 Bytes
Versions: 9
Compression:
Stored size: 758 Bytes
Contents
require 'spec_helper' describe GithubCLI::Util do describe '#flatten_has' do let(:hash) { { :a => { :b => { :c => 1 }}} } it 'preserves original hash' do hash = { :a => 1, :b => 2 } output = subject.flatten_hash hash output.should == hash end it "reduces multidimensional keys to one dimension" do output = subject.flatten_hash hash output.should == { :a_b_c => 1 } end end describe '#longest_common_prefix' do it 'finds common prefix' do a = 'tribe'; b = 'tree' subject.longest_common_prefix(a,b).should == "tr" end it 'fails to find common prefix' do a = 'foo'; b = 'bar' subject.longest_common_prefix(a,b).should be_empty end end end # GithubCLI::Util
Version data entries
9 entries across 9 versions & 1 rubygems