Exemplo n.º 1
0
  def test_run_bundler_with_deployment_option(self):
    module = FakeAnsibleModule()
    module.run_command = Mock(return_value=(0, "", ""))
    module.params = { 'deployment': True }

    bundler = BundlerModule(module)
    bundler.get_bundle_path = Mock(return_value='/bin/bandler')
    bundler.run_bundle()

    module.run_command.assert_called_with('/bin/bandler install --without=deployment:test --deployment', check_rc=True)
Exemplo n.º 2
0
  def test_run_bundler_with_gemfile_option(self):
    module = FakeAnsibleModule()
    module.run_command = Mock(return_value=(0, "", ""))
    module.params = { 'gemfile': '/path/to/Gemfile' }

    bundler = BundlerModule(module)
    bundler.get_bundle_path = Mock(return_value='/bin/bandler')
    bundler.run_bundle()

    module.run_command.assert_called_with(['/bin/bandler', 'install', '--without=deployment:test', '--gemfile=/path/to/Gemfile'], check_rc=True)
Exemplo n.º 3
0
  def test_get_bundle_path_without_executable(self):
    module = FakeAnsibleModule()
    module.get_bin_path = Mock(return_value='/bin/bandler')

    bundler = BundlerModule(module)
    assert bundler.get_bundle_path() == '/bin/bandler'
Exemplo n.º 4
0
  def test_get_bundle_path_with_defined_executable_parameter(self):
    module = FakeAnsibleModule()
    module.params['executable'] = '/bin/bandler'

    bundler = BundlerModule(module)
    assert bundler.get_bundle_path() == '/bin/bandler'