File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
spec/octocatalog-diff/tests/catalog Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 422
422
context 'when preserve_environments is not set' do
423
423
context 'and environment is specified' do
424
424
it 'should return without raising error when directory exists' do
425
- allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/production' ) . and_return ( true )
425
+ allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/production' ) . and_return ( false )
426
+ allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/custom' ) . and_return ( true )
426
427
described_object = described_class . allocate
427
- described_object . instance_variable_set ( '@opts' , environment : 'nope ' )
428
+ described_object . instance_variable_set ( '@opts' , environment : 'custom ' )
428
429
described_object . instance_variable_set ( '@builddir' , OpenStruct . new ( tempdir : '/tmp/assert' ) )
429
430
expect { described_object . send ( :assert_that_puppet_environment_directory_exists ) } . not_to raise_error
430
431
end
431
432
432
433
it 'should raise Errno::ENOENT when directory does not exist' do
433
- allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/production' ) . and_return ( false )
434
+ allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/production' ) . and_return ( true )
435
+ allow ( File ) . to receive ( :"directory?" ) . with ( '/tmp/assert/environments/custom' ) . and_return ( false )
434
436
described_object = described_class . allocate
435
- described_object . instance_variable_set ( '@opts' , environment : 'yup ' )
437
+ described_object . instance_variable_set ( '@opts' , environment : 'custom ' )
436
438
described_object . instance_variable_set ( '@builddir' , OpenStruct . new ( tempdir : '/tmp/assert' ) )
437
439
expect { described_object . send ( :assert_that_puppet_environment_directory_exists ) } . to raise_error ( Errno ::ENOENT )
438
440
end
You can’t perform that action at this time.
0 commit comments