]>
git.r.bdr.sh - rbdr/lyricli.rb/blob - spec/lib/lyricli/util_spec.rb
4 describe Lyricli
::Util do
20 describe
"#camelize" do
21 it
"should convert snake_case to CamelCase" do
22 expect(@c.camelize("test_string")).to
eq("TestString")
26 describe
"#parse_class" do
27 it
"should parse classes under the Source namespace" do
28 expect(@c.parse_class("ParsedClass")).to
eq(Lyricli
::Sources::ParsedClass)
31 it
"should return nil for nonexistent classes" do
32 expect(@c.parse_class("non_existent_class")).to
eq(nil)
36 describe
"#sanitize_param" do
37 it
"should escape weird characters, but conserve the +" do
38 str = "one two+three
/?&"
39 expect(@c.sanitize_param(str)).to eq("one+two+three+
%2F
%3F
%26")