Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Took advantage of RSpec's should_receive capabilities when testing Pr…

…oxy method delegation.
  • Loading branch information...
commit 67971334fd42a0889e07771dfb62ec71e4aedcb2 1 parent 3e26406
@laserlemon laserlemon authored binarylogic committed
Showing with 7 additions and 3 deletions.
  1. +7 −3 spec/proxy_spec.rb
View
10 spec/proxy_spec.rb
@@ -30,9 +30,13 @@
end
it "should delegate all other methods to the target" do
- target = ["TESTING", 1, 2, 3]
+ target = " Target "
proxy = Shippinglogic::Proxy.new(target)
- proxy.class.should == target.class
- proxy.size.should == target.size
+ methods = [:size, :upcase, :downcase, :strip]
+
+ methods.each do |method|
+ target.should_receive(method).twice
+ proxy.send(method).should == target.send(method)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.