Skip to content

Add specs for Fiber.schedule and Fiber.current_scheduler - #1388

Open
sampokuokkanen wants to merge 1 commit into
ruby:masterfrom
sampokuokkanen:fiber-schedule-specs
Open

Add specs for Fiber.schedule and Fiber.current_scheduler#1388
sampokuokkanen wants to merge 1 commit into
ruby:masterfrom
sampokuokkanen:fiber-schedule-specs

Conversation

@sampokuokkanen

Copy link
Copy Markdown
Contributor

Fiber.schedule and Fiber.current_scheduler had no specs. Cover the RuntimeError raised when no scheduler is set, that the scheduler's #fiber hook is called and its return value is what Fiber.schedule hands back, and that Fiber.schedule works from inside a non-blocking Fiber.

Fiber.current_scheduler returns the scheduler only when the current Fiber is non-blocking, which is what separates it from Fiber.scheduler. Cover the root Fiber, blocking and non-blocking Fibers,

Fiber.schedule and Fiber.current_scheduler had no specs. Cover the RuntimeError raised when no scheduler is set, that the scheduler's #fiber hook is called and its return value is what Fiber.schedule hands back, and that Fiber.schedule works from inside a non-blocking Fiber.

Fiber.current_scheduler returns the scheduler only when the current Fiber is non-blocking, which is what separates it from Fiber.scheduler. Cover the root Fiber, blocking and non-blocking Fibers,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant