Skip to content

Commit 06ebdf3

Browse files
author
Morgan Haskel
committed
Merge pull request #455 from hunner/change_type_of_test
Remove all the pops stuff
2 parents 1401e26 + 732f7e8 commit 06ebdf3

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

spec/functions/type_of_spec.rb

+6-26
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,12 @@
22

33
require 'spec_helper'
44

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
289

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)
3212
end
3313
end

0 commit comments

Comments
 (0)