File tree 1 file changed +6
-26
lines changed
1 file changed +6
-26
lines changed Original file line number Diff line number Diff line change 2
2
3
3
require 'spec_helper'
4
4
5
- if ENV [ "FUTURE_PARSER" ] == 'yes' or Puppet . version >= "4"
6
- require 'puppet/pops'
7
- require 'puppet/loaders'
8
-
9
- describe 'the type_of function' do
10
- before ( :all ) do
11
- loaders = Puppet ::Pops ::Loaders . new ( Puppet ::Node ::Environment . create ( :testing , [ File . join ( fixtures , "modules" ) ] ) )
12
- Puppet . push_context ( { :loaders => loaders } , "test-examples" )
13
- end
14
-
15
- after ( :all ) do
16
- Puppet ::Pops ::Loaders . clear
17
- Puppet ::pop_context ( )
18
- end
19
-
20
- let ( :func ) do
21
- # Load the function from the environment modulepath's modules (ie, fixtures)
22
- Puppet . lookup ( :loaders ) . private_environment_loader . load ( :function , 'type_of' )
23
- end
24
-
25
- it 'gives the type of a string' do
26
- expect ( func . call ( { } , 'hello world' ) ) . to be_kind_of ( Puppet ::Pops ::Types ::PStringType )
27
- end
5
+ describe 'type_of' , :if => Puppet . version . to_f >= 4.0 do
6
+ it 'gives the type of a string' do
7
+ expect ( subject . call_function ( 'type_of' , 'hello world' ) ) . to be_kind_of ( Puppet ::Pops ::Types ::PStringType )
8
+ end
28
9
29
- it 'gives the type of an integer' do
30
- expect ( func . call ( { } , 5 ) ) . to be_kind_of ( Puppet ::Pops ::Types ::PIntegerType )
31
- end
10
+ it 'gives the type of an integer' do
11
+ expect ( subject . call_function ( 'type_of' , 5 ) ) . to be_kind_of ( Puppet ::Pops ::Types ::PIntegerType )
32
12
end
33
13
end
You can’t perform that action at this time.
0 commit comments