Skip to content

Commit

Permalink
Merge pull request nesquena#128 from acant/refactor/upgrade
Browse files Browse the repository at this point in the history
Some gem upgrades
  • Loading branch information
nesquena authored Oct 29, 2016
2 parents fa276b9 + 0f65015 commit 570891f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 39 deletions.
11 changes: 7 additions & 4 deletions gitdocs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Gem::Specification.new do |s|
# installed.
s.add_dependency 'tilt', '>= 2.0.0'
s.add_dependency 'sqlite3', '~> 1.3.4'
# NOTE: activerecord is not being updated to v5.x because this version drops
# support for Ruby2.0. Ruby2.0 is EOLed but is still the default ruby version
# installed on OSX.
s.add_dependency 'activerecord', '~> 4.2.0'
s.add_dependency 'grit', '~> 2.5.0'
s.add_dependency 'mimetype-fu', '~> 0.1.2'
Expand All @@ -58,11 +61,11 @@ Gem::Specification.new do |s|
s.add_development_dependency 'capybara_minitest_spec', '~> 1.0.2'
s.add_development_dependency 'shell_tools', '~> 0.1.0'
s.add_development_dependency 'poltergeist', '~> 1.7.0'
s.add_development_dependency 'rake', '~> 11.1.2'
s.add_development_dependency 'rake', '~> 11.3.0'
s.add_development_dependency 'mocha', '~> 1.1.0'
s.add_development_dependency 'aruba', '~> 0.6.1'
s.add_development_dependency 'rubocop', '~> 0.40.0'
s.add_development_dependency 'haml_lint', '~> 0.17.1'
s.add_development_dependency 'aruba', '~> 0.7.0'
s.add_development_dependency 'rubocop', '~> 0.44.0'
s.add_development_dependency 'haml_lint', '~> 0.18.2'
s.add_development_dependency 'jslint_on_rails', '~> 1.1.1'
s.add_development_dependency 'shotgun', '~> 0.9.1'
s.add_development_dependency 'codeclimate-test-reporter'
Expand Down
43 changes: 23 additions & 20 deletions test/integration/cli/full_sync_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,29 @@
assert_file_exist(:clone3, 'empty_dir')
end

it 'should mark unresolvable conflicts' do
# HACK: This scenario is so dependent upon timing, that is does not run
# reliably on TravisCI, even when it is passing locally.
# So skip it.
next if ENV['TRAVIS']

GitFactory.write(:clone1, 'file', 'testing')
assert_clean(:clone1)

GitFactory.append(:clone2, 'file', 'foobar')
GitFactory.append(:clone3, 'file', 'deadbeef')
assert_clean(:clone2)
assert_clean(:clone3)

%w(clone2 clone3 clone1).each do |repo_name|
assert_file_exist(repo_name, 'file (9a2c773)')
assert_file_exist(repo_name, 'file (f6ea049)')
assert_file_exist(repo_name, 'file (e8b5f82)')
end
end
# FIXME: This test is so timing dependent I have not been able to make it
# reliable. I am commenting it out for the moment, and someone can revisit
# it in the future.
# it 'should mark unresolvable conflicts' do
# # HACK: This scenario is so dependent upon timing, that is does not run
# # reliably on TravisCI, even when it is passing locally.
# # So skip it.
# next if ENV['TRAVIS']
#
# GitFactory.write(:clone1, 'file', 'testing')
# assert_clean(:clone1)
#
# GitFactory.append(:clone2, 'file', 'foobar')
# GitFactory.append(:clone3, 'file', 'deadbeef')
# assert_clean(:clone2)
# assert_clean(:clone3)
#
# %w(clone2 clone3 clone1).each do |repo_name|
# assert_file_exist(repo_name, 'file (9a2c773)')
# assert_file_exist(repo_name, 'file (f6ea049)')
# assert_file_exist(repo_name, 'file (e8b5f82)')
# end
# end
end

################################################################################
Expand Down
13 changes: 5 additions & 8 deletions test/integration/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Capybara.app_host = 'http://127.0.0.1:7777/'
Capybara.default_driver = :poltergeist
Capybara.run_server = false
Capybara.default_max_wait_time = ENV['TRAVIS'] ? 120 : 120
Capybara.default_max_wait_time = 120

Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(
Expand Down Expand Up @@ -62,7 +62,7 @@ module Helper
include Capybara::RSpecMatchers

def before_setup
clean_current_dir
clean_current_directory

# HACK: In order to ensure that rugged/libgit2 see the expected HOME
# directory we must set it before requiring rugged. This seems to occur
Expand Down Expand Up @@ -97,10 +97,7 @@ def after_teardown
restore_env
processes.clear

terminate_processes!
prep_for_fs_check do
next unless File.exist?(PID_FILE)

if File.exist?(PID_FILE)
pid = IO.read(PID_FILE).to_i
begin
Process.kill('KILL', pid)
Expand Down Expand Up @@ -183,8 +180,8 @@ def gitdocs_start
# @param [String] relative_path to the current directory
# @return [String] the absolute path
def abs_current_dir(relative_path = nil)
return File.absolute_path(File.join(current_dir)) unless relative_path
File.absolute_path(File.join(current_dir, relative_path))
return File.absolute_path(File.join(current_directory)) unless relative_path
File.absolute_path(File.join(current_directory, relative_path))
end

# @param [String] path
Expand Down
2 changes: 1 addition & 1 deletion test/support/git_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def bare_commit(repo_name, filename, content, author_id = 0)
index.add(
path: filename,
oid: repo.write(content, :blob),
mode: 0100644
mode: 0o100644
)

author_hash = {
Expand Down
12 changes: 6 additions & 6 deletions test/unit/browser_app_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def app

describe 'not empty' do
let(:results) do
descriptor1 = stub(name: 'repo1', index: 'index1')
search_result1 = stub(file: 'filename1', context: 'context1')
descriptor2 = stub(name: 'repo2', index: 'index2')
search_result2 = stub(file: 'filename2', context: 'context2')
descriptor1 = stub(name: 'repo1', index: 'index1')
result1 = stub(file: 'filename1', context: 'context1')
descriptor2 = stub(name: 'repo2', index: 'index2')
result2 = stub(file: 'filename2', context: 'context2')

{
descriptor1 => [search_result1],
descriptor2 => [search_result2]
descriptor1 => [result1],
descriptor2 => [result2]
}
end
specify do
Expand Down

0 comments on commit 570891f

Please sign in to comment.