class EacRubyGemsUtils::Tests::Multiple::DecoratedGem

Public Instance Methods

prepare() click to toggle source
# File lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb, line 11
def prepare
  return unless gemfile_path.exist?

  log('running "bundle install"...')
  return if bundle('install').execute.fetch(:exit_code).zero?

  unless can_remove_gemfile_lock?
    raise '"bundle install" failed and the Gemfile.lock is part of gem' \
        '(Should be changed by developer)'
  end

  prepare_with_removable_gemfile_lock
end
tests() click to toggle source
# File lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb, line 25
def tests
  [::EacRubyGemsUtils::Tests::Minitest.new(__getobj__),
   ::EacRubyGemsUtils::Tests::Rspec.new(__getobj__)]
end

Private Instance Methods

can_remove_gemfile_lock?() click to toggle source
# File lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb, line 42
def can_remove_gemfile_lock?
  !files.include?(gemfile_lock_path.relative_path_from(root))
end
log(message) click to toggle source
# File lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb, line 32
def log(message)
  infov self, message
end
prepare_with_removable_gemfile_lock() click to toggle source
# File lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb, line 36
def prepare_with_removable_gemfile_lock
  log('"bundle install" failed, removing Gemfile.lock and trying again...')
  gemfile_lock_path.unlink if gemfile_lock_path.exist?
  bundle('install').execute!
end