Permalink
Browse files

Savon::Spec::Mock#expects leaves the case of Strings alone.

This way, when you call a SOAP method that starts with a capital
letter, you can write a test for it. Before, any test would fail with
"expected :createThing to be called, got: :CreateThing".
  • Loading branch information...
1 parent 4303b0e commit 6b66fbc39956466d0ceea60a0f532eae0da6d489 @smerritt committed Oct 3, 2011
Showing with 18 additions and 1 deletion.
  1. +5 −1 lib/savon/spec/mock.rb
  2. +13 −0 spec/savon/spec/mock_spec.rb
@@ -73,7 +73,11 @@ def never
private
def action=(action)
- @action = action.to_s.lower_camelcase.to_sym
+ if action.is_a?(String)
+ @action = action.to_sym
+ else
+ @action = action.to_s.lower_camelcase.to_sym
+ end
end
attr_reader :action
@@ -33,6 +33,19 @@
end
+ describe "#expects" do
+
+ before do
+ savon.expects("CreateTLAThing")
+ end
+
+ it "does not alter the case of strings" do
+ client.request("CreateTLAThing")
+ end
+
+ end
+
+
describe "#with" do
context "a Hash" do

0 comments on commit 6b66fbc

Please sign in to comment.