Skip to content

bruno-/fiber_scheduler_spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiber scheduler spec

Building a Ruby fiber scheduler is hard. This gem helps with testing it.

Works with fiber schedulers in ruby 3.1.

This is NOT a specification, here are the official docs for fiber scheduler.

Installation

gem install fiber_scheduler_spec

Usage

Run all the specs on CustomFiberScheduler:

# spec/custom_fiber_scheduler/fiber_scheduler_spec.rb
require "fiber_scheduler_spec"

RSpec.describe CustomFiberScheduler do
  include_examples FiberSchedulerSpec
end

or

Run a subset of specs (just comment out example groups you don't need):

# spec/custom_fiber_scheduler/fiber_scheduler_spec.rb
require "fiber_scheduler_spec"

RSpec.describe CustomFiberScheduler do
  include_examples FiberSchedulerSpec::BlockUnblock
  include_examples FiberSchedulerSpec::Close
  include_examples FiberSchedulerSpec::Fiber
  include_examples FiberSchedulerSpec::IOWait
  include_examples FiberSchedulerSpec::KernelSleep
  include_examples FiberSchedulerSpec::NestedFiberSchedule
  include_examples FiberSchedulerSpec::ProcessWait
  include_examples FiberSchedulerSpec::SocketIO
  include_examples FiberSchedulerSpec::TimeoutAfter
end

More info

This gem assumes your fiber scheduler implements:

License

MIT

About

Common specs for a Ruby fiber scheduler

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages