File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ if Puppet ::Util ::Package . versioncmp ( Puppet . version , '4.5.0' ) >= 0
4
+ describe 'Stdlib::HttpStatus' do
5
+ describe 'valid HTTP Status' do
6
+ [
7
+ 200 ,
8
+ 302 ,
9
+ 404 ,
10
+ 418 ,
11
+ 503 ,
12
+ ] . each do |value |
13
+ describe value . inspect do
14
+ it { is_expected . to allow_value ( value ) }
15
+ end
16
+ end
17
+ end
18
+
19
+ describe 'invalid path handling' do
20
+ context 'garbage inputs' do
21
+ [
22
+ nil ,
23
+ [ nil ] ,
24
+ [ nil , nil ] ,
25
+ { 'foo' => 'bar' } ,
26
+ { } ,
27
+ '' ,
28
+ 'https' ,
29
+ '199' ,
30
+ 600 ,
31
+ 1_000 ,
32
+ ] . each do |value |
33
+ describe value . inspect do
34
+ it { is_expected . not_to allow_value ( value ) }
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
Original file line number Diff line number Diff line change
1
+ type Stdlib::HttpStatus = Integer[100 , 599 ]
You can’t perform that action at this time.
0 commit comments