Module: EventMachine

Defined in:
lib/em-spec/test.rb,
lib/em-spec/bacon.rb,
lib/em-spec/bacon.rb,
lib/em-spec/rspec.rb,
lib/em-spec/version.rb

Defined Under Namespace

Modules: Spec, SpecHelper, Test, TestHelper

Constant Summary collapse

TestTimeoutExceededError =
Class.new(RuntimeError)

Class Method Summary collapse

Class Method Details

.bacon(*args, &block) ⇒ Object



23
24
25
26
27
# File 'lib/em-spec/bacon.rb', line 23

def self.bacon( *args, &block )
  require File.dirname(__FILE__) + '/spec/bacon'
  self.spec_backend = EventMachine::Spec::Bacon
  self.spec( args, &block )
end

.spec(*args, &blk) ⇒ Object Also known as: describe

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'lib/em-spec/bacon.rb', line 15

def self.spec *args, &blk
  raise ArgumentError, 'block required' unless block_given?
  raise 'EventMachine reactor already running' if EM.reactor_running?

  spec_backend.spec( args, blk )
end

.spec_backendObject



11
12
13
# File 'lib/em-spec/bacon.rb', line 11

def self.spec_backend
  @spec_backend
end

.spec_backend=(backend) ⇒ Object



7
8
9
# File 'lib/em-spec/bacon.rb', line 7

def self.spec_backend=( backend )
  @spec_backend = backend
end