Permalink
Browse files

improve test coverage of String#translate

  • Loading branch information...
1 parent 143fab1 commit 0bcdf9a6d42be83829fe62f40532aa63536f0b8c @jimmycuadra jimmycuadra committed Dec 25, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/to_lang_spec.rb
View
@@ -25,5 +25,13 @@
it "responds to :translate" do
String.new.should respond_to :translate
end
+
+ context "when sent :translate" do
+ it "calls ToLang::Connector#request" do
+ ToLang.connector.stub(:request)
+ ToLang.connector.should_receive(:request).with("hello world", "es")
+ "hello world".translate("es")
+ end
+ end
end
end

0 comments on commit 0bcdf9a

Please sign in to comment.