5: def self.included(mod)
6: RR.trim_backtrace = true
7: mod.class_eval do
8: unless instance_methods.detect {|method_name| method_name.to_sym == :setup_with_rr}
9: alias_method :setup_without_rr, :setup
10: def setup_with_rr
11: setup_without_rr
12: RR.reset
13: end
14: alias_method :setup, :setup_with_rr
15:
16: alias_method :teardown_without_rr, :teardown
17: def teardown_with_rr
18: RR.verify
19: teardown_without_rr
20: end
21: alias_method :teardown, :teardown_with_rr
22: end
23: end
24: end