spec/unit/around_spec.rb in aspector-0.8.0 vs spec/unit/around_spec.rb in aspector-0.9.0
- old
+ new
@@ -1,13 +1,13 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "Around advices" do
it "should work" do
klass = create_test_class do
- def do_this &block
+ def do_this proxy, &block
value << "before"
- result = block.call
+ result = proxy.call &block
value << "after"
result
end
end
@@ -22,13 +22,13 @@
it "logic in block" do
klass = create_test_class
aspector(klass) do
- around :test do |&block|
+ around :test do |proxy, &block|
value << "before"
- result = block.call
+ result = proxy.call &block
value << "after"
result
end
end
@@ -37,12 +37,12 @@
obj.value.should == %w"before test after"
end
it "method_name_arg" do
klass = create_test_class do
- def do_this method, &block
+ def do_this method, proxy, &block
value << "before(#{method})"
- result = block.call
+ result = proxy.call &block
value << "after(#{method})"
result
end
end