File: authencryptionkey_spec.rb

package info (click to toggle)
puppet-module-heat 25.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,560 kB
  • sloc: ruby: 3,889; python: 38; sh: 10; makefile: 10
file content (40 lines) | stat: -rw-r--r-- 1,026 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
require 'spec_helper'

describe 'Heat::AuthEncryptionKey' do
  describe 'valid types' do
    context 'with valid types' do
      [
        '0123456789abcdef',
        '0123456789abcdefghijklmn',
        '0123456789abcdefghijklmnopqrstuv'
      ].each do |value|
        describe value.inspect do
          it { is_expected.to allow_value(value) }
        end
      end
    end
  end

  describe 'invalid types' do
    context 'with garbage inputs' do
      [
        1234567890123456,
        true,
        false,
        nil,
        {'0123456789abcdefghijklmnopqrstuv' => '0123456789abcdefghijklmnopqrstuv'},
        ['0123456789abcdefghijklmnopqrstuv'],
        '0123456789abcde',
        '0123456789abcdefg',
        '0123456789abcdefghijklm',
        '0123456789abcdefghijklmno',
        '0123456789abcdefghijklmnopqrstu',
        '0123456789abcdefghijklmnopqrstuvw',
      ].each do |value|
        describe value.inspect do
          it { is_expected.not_to allow_value(value) }
        end
      end
    end
  end
end