Skip to content

Commit

Permalink
Backfill a spec for the camelcase xml_key converter
Browse files Browse the repository at this point in the history
Unsure if this is actually correct - it seems like it **should** actually
camelcase on ^ | and _, stripping those characters out. It's hard to imagine
why that would be necessary without any additional context, or seeing some WSDLs.

#46
  • Loading branch information
tjarratt committed Sep 24, 2014
1 parent b7c783d commit fa67177
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/gyoku/xml_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
expect(create(:lower_camel_case!)).to eq("lowerCamelCase")
end

context "when the converter option is set to camelcase" do
it "should replace / with ::, and turn snake case into camel case" do
input = "hello_world_bob/how_are_you|there:foo^bar".to_sym
expected_output = "HelloWorldBob::HowAreYou|there:foo^bar"
expect(create(input, {key_converter: :camelcase})).to eq(expected_output)
end
end

context "with key_converter" do
it "convert symbol to the specified type" do
expect(create(:some_text, {key_converter: :camelcase})).to eq("SomeText")
Expand Down

0 comments on commit fa67177

Please sign in to comment.