Skip to content
Browse files

wrapping tests

  • Loading branch information...
1 parent 18d14b2 commit dce54a675648611e173ed5d00c68eb2206777443 @fabiokung committed Apr 26, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 test/test_decorators.rb
View
12 test/test_decorators.rb
@@ -66,5 +66,17 @@ def test_accepts_tags_and_hash
assert_equal "myservice release=v51 basic that works data=useful number=10\n", @@output.gets
end
+ def test_wraps_method
+ @service.basic_wrap_with_logging
+ assert_equal "myservice release=v51 class=MyService method=basic_wrap_with_logging at=start\n", @@output.gets
+ assert_includes @@output.gets, "myservice release=v51 class=MyService method=basic_wrap_with_logging at=finish elapsed=0.1"
+ end
+
+ def test_wraps_method_with_context
+ @service.wrap_with_more_context
+ assert_equal "myservice release=v51 wrap_with_more_context rule=always class=MyService method=wrap_with_more_context at=start\n", @@output.gets
+ assert_includes @@output.gets, "myservice release=v51 wrap_with_more_context rule=always class=MyService method=wrap_with_more_context at=finish elapsed=0.1"
+ end
+
end

0 comments on commit dce54a6

Please sign in to comment.
Something went wrong with that request. Please try again.