3 describe Puppet::Type.type(:file_line) do
5 @file_line = Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'line', :path => '/tmp/path')
7 it 'should accept a line and path' do
8 @file_line[:line] = 'my_line'
9 @file_line[:line].should == 'my_line'
11 it 'should accept posix filenames' do
12 @file_line[:path] = '/tmp/path'
13 @file_line[:path].should == '/tmp/path'
15 it 'should not accept unqualified path' do
16 expect { @file_line[:path] = 'file' }.should raise_error(Puppet::Error, /File paths must be fully qualified/)
18 it 'should require that a line is specified' do
19 expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file') }.should raise_error(Puppet::Error, /Both line and path are required attributes/)
21 it 'should require that a file is specified' do
22 expect { Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'path') }.should raise_error(Puppet::Error, /Both line and path are required attributes/)