Skip to content

Commit

Permalink
Merge pull request #455 from hunner/change_type_of_test
Browse files Browse the repository at this point in the history
Remove all the pops stuff
  • Loading branch information
Morgan Haskel committed May 21, 2015
2 parents 1401e26 + 732f7e8 commit 06ebdf3
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions spec/functions/type_of_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,12 @@

require 'spec_helper'

if ENV["FUTURE_PARSER"] == 'yes' or Puppet.version >= "4"
require 'puppet/pops'
require 'puppet/loaders'

describe 'the type_of function' do
before(:all) do
loaders = Puppet::Pops::Loaders.new(Puppet::Node::Environment.create(:testing, [File.join(fixtures, "modules")]))
Puppet.push_context({:loaders => loaders}, "test-examples")
end

after(:all) do
Puppet::Pops::Loaders.clear
Puppet::pop_context()
end

let(:func) do
# Load the function from the environment modulepath's modules (ie, fixtures)
Puppet.lookup(:loaders).private_environment_loader.load(:function, 'type_of')
end

it 'gives the type of a string' do
expect(func.call({}, 'hello world')).to be_kind_of(Puppet::Pops::Types::PStringType)
end
describe 'type_of', :if => Puppet.version.to_f >= 4.0 do
it 'gives the type of a string' do
expect(subject.call_function('type_of', 'hello world')).to be_kind_of(Puppet::Pops::Types::PStringType)
end

it 'gives the type of an integer' do
expect(func.call({}, 5)).to be_kind_of(Puppet::Pops::Types::PIntegerType)
end
it 'gives the type of an integer' do
expect(subject.call_function('type_of', 5)).to be_kind_of(Puppet::Pops::Types::PIntegerType)
end
end

0 comments on commit 06ebdf3

Please sign in to comment.