Class: EventMachine::Ventually::Eventually::RSpec
Instance Attribute Summary
#expectation
Class Method Summary
collapse
Instance Method Summary
collapse
#formatted_message, #initialize, #kill_timer, #process_test, #run, #stop, #test
Class Method Details
.inject ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/em-ventually/eventually/rspec.rb', line 5
def self.inject
unless ::RSpec::Core::ExampleGroup.public_method_defined?(:_em)
::RSpec::Core::ExampleGroup.class_eval <<-EOT, __FILE__, __LINE__ + 1
include EM::Ventually::Emify
alias_method :original_instance_eval, :instance_eval
def instance_eval(&block)
_em { original_instance_eval(&block) }
end
EOT
end
end
|
Instance Method Details
#assert_test(result) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/em-ventually/eventually/rspec.rb', line 21
def assert_test(result)
e = expectation
if super
msg = formatted_message("#{result.inspect} passed")
@runner.instance_eval do
1.should == 1
end
true
else
false
end
end
|
#report(msg) ⇒ Object
17
18
19
|
# File 'lib/em-ventually/eventually/rspec.rb', line 17
def report(msg)
::RSpec::Expectations.fail_with(msg)
end
|