File: key_spec.rb

package info (click to toggle)
puppet 5.5.22-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,316 kB
  • sloc: ruby: 254,925; sh: 1,608; xml: 219; makefile: 153; sql: 103
file content (41 lines) | stat: -rw-r--r-- 916 bytes parent folder | download | duplicates (9)
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
require 'spec_helper'

require 'puppet/graph'

describe Puppet::Graph::Key do
  it "produces the next in the sequence" do
    key = Puppet::Graph::Key.new

    expect(key.next).to be > key
  end

  it "produces a key after itself but before next" do
    key = Puppet::Graph::Key.new
    expect(key.down).to be > key
    expect(key.down).to be < key.next
  end

  it "downward keys of the same group are in sequence" do
    key = Puppet::Graph::Key.new

    first = key.down
    middle = key.down.next
    last = key.down.next.next

    expect(first).to be < middle
    expect(middle).to be < last
    expect(last).to be < key.next
  end

  it "downward keys in sequential groups are in sequence" do
    key = Puppet::Graph::Key.new

    first = key.down
    middle = key.next
    last = key.next.down

    expect(first).to be < middle
    expect(middle).to be < last
    expect(last).to be < key.next.next
  end
end