File: descendants_tracker_spec.rb

package info (click to toggle)
ruby-dry-core 0.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: ruby: 2,126; sh: 4; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 432 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
# frozen_string_literal: true

require "dry/core/descendants_tracker"

RSpec.describe Dry::Core::DescendantsTracker do
  before do
    module Test
      class Parent
        extend Dry::Core::DescendantsTracker
      end

      class Child < Parent
      end

      class Grandchild < Child
      end
    end
  end

  it "tracks descendants" do
    expect(Test::Parent.descendants).to eql([Test::Grandchild, Test::Child])
  end
end