Debian Codegraph @

spec/unit/type/nova_service_spec.rb

raw
1 require 'puppet'
2 require 'puppet/type/nova_service'
3
4 describe Puppet::Type.type(:nova_service) do
5
6 before :each do
7 Puppet::Type.rmtype(:nova_service)
8 end
9
10 it 'should raise error for setting ids property' do
11 incorrect_input = {
12 :name => 'test_type',
13 :ids => 'some_id'
14 }
15 expect { Puppet::Type.type(:nova_service).new(incorrect_input) }.to raise_error(Puppet::ResourceError, /This is a read only property/)
16 end
17
18 it 'should raise error if wrong format of name' do
19 incorrect_input = {
20 :name => ['node-1','node-2'],
21 }
22 expect { Puppet::Type.type(:nova_service).new(incorrect_input) }.to raise_error(Puppet::ResourceError, /name parameter must be a String/)
23 end
24 end