describeGitlab::Utils,lib: truedodefto_boolean(value)described_class.to_boolean(value)enddescribe'.to_boolean'doit'accepts booleans'doexpect(to_boolean(true)).tobe(true)expect(to_boolean(false)).tobe(false)endit'converts a valid string to a boolean'doexpect(to_boolean(true)).tobe(true)expect(to_boolean('true')).tobe(true)expect(to_boolean('YeS')).tobe(true)expect(to_boolean('t')).tobe(true)expect(to_boolean('1')).tobe(true)expect(to_boolean('ON')).tobe(true)expect(to_boolean('FaLse')).tobe(false)expect(to_boolean('F')).tobe(false)expect(to_boolean('NO')).tobe(false)expect(to_boolean('n')).tobe(false)expect(to_boolean('0')).tobe(false)expect(to_boolean('oFF')).tobe(false)endit'converts an invalid string to nil'doexpect(to_boolean('fals')).tobe_nilexpect(to_boolean('yeah')).tobe_nilexpect(to_boolean('')).tobe_nilexpect(to_boolean(nil)).tobe_nilendendend