Module: EventMachine::Test

Defined in:
lib/em-spec/test.rb

Class Method Summary collapse

Class Method Details

.included(cls) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/em-spec/test.rb', line 70

def self.included(cls)
  cls.class_eval("    def self.default_timeout(timeout)\n      self.send(:remove_const, :DefaultTimeout)\n      self.send(:const_set, :DefaultTimeout, timeout)\n    end\n    \n    include TestHelper\n\n    alias_method :run_without_em, :run\n    def run(result, &block)\n      em(DefaultTimeout) { run_without_em(result, &block) }\n    rescue Exception => e\n      if RUBY_VERSION >= \"1.9.1\"\n        result.puke(self.class, @name, e)\n      else\n        add_error($!)\n      end\n    end\n    \n  HERE_DOC\n  \nend\n", __FILE__, __LINE__)