File: root_spec.rb

package info (click to toggle)
ruby-celluloid 0.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 848 kB
  • sloc: ruby: 7,579; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 767 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
RSpec.describe Celluloid::Supervision::Service::Root, actor_system: :global do
  class RootTestingActor
    include Celluloid
    def identity
      :testing
    end
  end

  before(:all) do
    Celluloid::Supervision::Configuration.resync_parameters
  end

  context("deploys root services") do
    it("properly") do
      expect(Celluloid.actor_system.registered).to eq(Celluloid::Actor::System::ROOT_SERVICES.map { |r| r[:as] })
    end
  end

  context("makes public services available") do
    it("properly") do
      expect(Celluloid.services.respond_to?(:supervise)).to be_truthy
    end
    it("and accepts one-off actor supervision") do
      RootTestingActor.supervise as: :tester
      expect(Celluloid[:tester].identity).to eq(:testing)
    end
  end
end