File tree Expand file tree Collapse file tree
spec/octocatalog-diff/tests/catalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change 422422 context 'when preserve_environments is not set' do
423423 context 'and environment is specified' do
424424 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 )
426427 described_object = described_class . allocate
427- described_object . instance_variable_set ( '@opts' , environment : 'nope ' )
428+ described_object . instance_variable_set ( '@opts' , environment : 'custom ' )
428429 described_object . instance_variable_set ( '@builddir' , OpenStruct . new ( tempdir : '/tmp/assert' ) )
429430 expect { described_object . send ( :assert_that_puppet_environment_directory_exists ) } . not_to raise_error
430431 end
431432
432433 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 )
434436 described_object = described_class . allocate
435- described_object . instance_variable_set ( '@opts' , environment : 'yup ' )
437+ described_object . instance_variable_set ( '@opts' , environment : 'custom ' )
436438 described_object . instance_variable_set ( '@builddir' , OpenStruct . new ( tempdir : '/tmp/assert' ) )
437439 expect { described_object . send ( :assert_that_puppet_environment_directory_exists ) } . to raise_error ( Errno ::ENOENT )
438440 end
You can’t perform that action at this time.
0 commit comments