File: behavior_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 (74 lines) | stat: -rw-r--r-- 1,669 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
RSpec.describe Celluloid::Supervision::Container::Behavior do
  class WellBehaved
    include Celluloid
  end

  let(:typeless) do
    {
      as: :testing_behaviors,
      supervises: [
        {
          as: :testing_behaved_instances,
          type: WellBehaved
        }
      ]
    }
  end

  let(:normal) do
    {
      as: :testing_behaviors,
      supervises: [
        {
          as: :testing_behaved_instances,
          type: WellBehaved
        }
      ]
    }
  end

  let(:mutant) do
    {
      as: :testing_behaviors,
      supervise: [],
      supervises: [
        {
          as: :testing_behaved_instances,
          type: WellBehaved
        }
      ]
    }
  end

  subject { Celluloid::Supervision::Configuration.new }

  it("detects default type if not provided, and provides it") do
  end

  it("prejudicially rejects mutants") do
    expect { subject.define(mutant) }.to raise_error(Celluloid::Supervision::Container::Behavior::Error::Mutant)
  end

  context("allows definition of new plugins") do
    class TestPlugin
      include Celluloid::Supervision::Container::Behavior
      identifier! :identifying_parameter, :aliased_identifier
    end

    xit("and adds a plugin parameter") do
      expect(Celluloid::Supervision::Configuration.parameters(:plugins)).to include(:identifying_parameter)
    end

    xit("and adds aliased parameters") do
      expect(Celluloid::Supervision::Configuration.aliases.keys?).to include(:aliased_identifier)
    end
  end

  context("allows inclusion by Module") do
    xit("with automatic addition of injections") do
    end

    xit("with correct handling of injections made") do
    end
  end
end