|
326 | 326 | context 'and environment is specified' do
|
327 | 327 | it 'should return without raising error when directory exists' do
|
328 | 328 | described_object = described_class.allocate
|
329 |
| - described_object.instance_variable_set('@opts', preserve_environments: true, environment: 'yup') |
| 329 | + described_object.instance_variable_set('@options', preserve_environments: true, environment: 'yup') |
330 | 330 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
331 | 331 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.not_to raise_error
|
332 | 332 | end
|
333 | 333 |
|
334 | 334 | it 'should raise Errno::ENOENT when directory does not exist' do
|
335 | 335 | described_object = described_class.allocate
|
336 |
| - described_object.instance_variable_set('@opts', preserve_environments: true, environment: 'nope') |
| 336 | + described_object.instance_variable_set('@options', preserve_environments: true, environment: 'nope') |
337 | 337 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
338 | 338 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.to raise_error(Errno::ENOENT)
|
339 | 339 | end
|
|
343 | 343 | it 'should return without raising error when directory exists' do
|
344 | 344 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(true)
|
345 | 345 | described_object = described_class.allocate
|
346 |
| - described_object.instance_variable_set('@opts', preserve_environments: true) |
| 346 | + described_object.instance_variable_set('@options', preserve_environments: true) |
347 | 347 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
348 | 348 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.not_to raise_error
|
349 | 349 | end
|
350 | 350 |
|
351 | 351 | it 'should raise Errno::ENOENT when directory does not exist' do
|
352 | 352 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(false)
|
353 | 353 | described_object = described_class.allocate
|
354 |
| - described_object.instance_variable_set('@opts', preserve_environments: true, environment: 'nope') |
| 354 | + described_object.instance_variable_set('@options', preserve_environments: true, environment: 'nope') |
355 | 355 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
356 | 356 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.to raise_error(Errno::ENOENT)
|
357 | 357 | end
|
|
364 | 364 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(false)
|
365 | 365 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/custom').and_return(true)
|
366 | 366 | described_object = described_class.allocate
|
367 |
| - described_object.instance_variable_set('@opts', environment: 'custom') |
| 367 | + described_object.instance_variable_set('@options', environment: 'custom') |
368 | 368 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
369 | 369 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.not_to raise_error
|
370 | 370 | end
|
|
373 | 373 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(true)
|
374 | 374 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/custom').and_return(false)
|
375 | 375 | described_object = described_class.allocate
|
376 |
| - described_object.instance_variable_set('@opts', environment: 'custom') |
| 376 | + described_object.instance_variable_set('@options', environment: 'custom') |
377 | 377 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
378 | 378 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.to raise_error(Errno::ENOENT)
|
379 | 379 | end
|
|
383 | 383 | it 'should return without raising error when directory exists' do
|
384 | 384 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(true)
|
385 | 385 | described_object = described_class.allocate
|
386 |
| - described_object.instance_variable_set('@opts', {}) |
| 386 | + described_object.instance_variable_set('@options', {}) |
387 | 387 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
388 | 388 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.not_to raise_error
|
389 | 389 | end
|
390 | 390 |
|
391 | 391 | it 'should raise Errno::ENOENT when directory does not exist' do
|
392 | 392 | allow(File).to receive(:"directory?").with('/tmp/assert/environments/production').and_return(false)
|
393 | 393 | described_object = described_class.allocate
|
394 |
| - described_object.instance_variable_set('@opts', {}) |
| 394 | + described_object.instance_variable_set('@options', {}) |
395 | 395 | described_object.instance_variable_set('@builddir', OpenStruct.new(tempdir: '/tmp/assert'))
|
396 | 396 | expect { described_object.send(:assert_that_puppet_environment_directory_exists) }.to raise_error(Errno::ENOENT)
|
397 | 397 | end
|
|
0 commit comments