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)
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)
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'
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'