From 41d0de5b9cfaf1034a1f9427b69c4faf1a280696 Mon Sep 17 00:00:00 2001 From: Adam Hess Date: Tue, 7 Apr 2020 17:28:00 -0700 Subject: [PATCH] Fix assigned but unused variable warnings in test --- test/repo_apply_test.rb | 6 +++--- test/settings_test.rb | 2 +- test/submodule_test.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/repo_apply_test.rb b/test/repo_apply_test.rb index 836a631f3..f25a1b40c 100644 --- a/test/repo_apply_test.rb +++ b/test/repo_apply_test.rb @@ -103,13 +103,13 @@ def test_bare_repository_defaults_to_index assert_index_content 'README', new_content, bare_repo diff = bare_repo.diff(new_commit, original_commit) - + assert_equal true, bare_repo.apply(diff) assert_index_content 'README', original_content, bare_repo end def test_location_option - new_commit, new_content, original_content = update_file(@repo, 'README') + new_commit, _new_content, _original_content = update_file(@repo, 'README') diff = @repo.diff(new_commit, @original_commit) @@ -166,4 +166,4 @@ def test_callbacks @repo.apply(diff, {:location => :index, :hunk_callback => 'this is not a callable object'}) end end -end \ No newline at end of file +end diff --git a/test/settings_test.rb b/test/settings_test.rb index de1d8cecf..3874ff0f2 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -14,7 +14,7 @@ def test_used_cache_size size = Rugged::Settings.used_cache_size repo = FixtureRepo.from_libgit2("attr") - diff = repo.diff("605812a", "370fe9ec22", :context_lines => 1, :interhunk_lines => 1) + repo.diff("605812a", "370fe9ec22", :context_lines => 1, :interhunk_lines => 1) # cache size should grow assert_operator size, :<, Rugged::Settings.used_cache_size diff --git a/test/submodule_test.rb b/test/submodule_test.rb index fd9979908..a09eb8094 100644 --- a/test/submodule_test.rb +++ b/test/submodule_test.rb @@ -278,7 +278,7 @@ def test_submodule_setup_add end # add a submodule using gitlink by default - submodule = @repo.submodules.setup_add(url, submod_path) + @repo.submodules.setup_add(url, submod_path) assert File.file?(File.join(@repo.workdir, submod_path, '.git')) assert File.directory?(File.join(@repo.path, 'modules')) @@ -287,7 +287,7 @@ def test_submodule_setup_add assert_equal url, @repo.config["submodule.#{submod_path}.url"] - submodule = @repo.submodules.setup_add(url, second_submod_path, gitlink: false) + @repo.submodules.setup_add(url, second_submod_path, gitlink: false) assert File.directory?(File.join(@repo.workdir, second_submod_path, '.git')) refute File.exist?(File.join(@repo.path, 'modules', second_submod_path))