Sha256: a4e745a3185d19411a353ca544b7b4340b10623fc2a3fd58f9a7d083833fc7b0

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Fiber do
  before(:each) do
    @fiber = Fiber.new do
      (1..10).each { |i| Fiber.yield }
    end
  end

  it 'should respond to all the class methods' do
    Fiber.should respond_to(*%w(yield current))
  end

  it 'should respond to all the instance methods' do
    @fiber.should respond_to(*%w(resume yield))
  end

  it 'should raise an error when it is done' do
    lambda { 100.times { @fiber.resume } }.should raise_error
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
darkhelmet-darkext-0.11.0 spec/fiber_spec.rb