Example #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)
Example #2
0
  def test_install_with_updated_gems(self):
    updated_output = """
      1 upgrade rails to 3.2.16
    Using i18n (0.6.9)"""
    assert BundlerModule(None).gems_were_changed(updated_output) == True

    old_updated_output = """
    Updating rails to 3.2.16
    Using i18n (0.6.9)"""
    assert BundlerModule(None).gems_were_changed(old_updated_output) == True
Example #3
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)
Example #4
0
  def test_install_without_changes(self):
    existing_output = """Using rake (10.1.1)
    Using i18n (0.6.9)"""

    assert BundlerModule(None).gems_were_changed(existing_output) == False
Example #5
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'
Example #6
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'
Example #7
0
 def test_install_with_new_gems(self):
   install_output = """
   Installing i18n (0.6.9)"""
   assert BundlerModule(None).gems_were_changed(install_output) == True