Fix Deprecation Warnings

This commit is contained in:
Daniel Levy 2018-11-27 15:02:42 -08:00
parent 5ce4ac934c
commit 2cb9639047
4 changed files with 8 additions and 12 deletions

View file

@ -163,7 +163,7 @@ class TestGenerateLocalizationFileCLI < CLITest
def test_missing_argument
assert_raises Twine::Error do
parse "generate-localization-file #{@twine_file}"
parse "generate-localization-file #{@twine_file_path}"
end
end

View file

@ -24,10 +24,6 @@ class TestGenerateAllLocalizationFiles < CommandTest
def setup
super
Dir.mkdir File.join @output_dir, 'values-en'
# both Android and Tizen can handle folders containing `values-en`
android_formatter = prepare_mock_formatter(Twine::Formatters::Android)
tizen_formatter = prepare_mock_formatter(Twine::Formatters::Tizen, false)
end
def new_runner(options = {})
@ -60,7 +56,7 @@ class TestGenerateAllLocalizationFiles < CommandTest
def test_does_not_create_language_folders
Dir.mkdir File.join @output_dir, 'en.lproj'
new_runner.generate_all_localization_files
refute File.exists?(File.join(@output_dir, 'es.lproj')), "language folder should not be created"
refute File.exist?(File.join(@output_dir, 'es.lproj')), "language folder should not be created"
end
def test_prints_empty_file_warnings
@ -86,13 +82,13 @@ class TestGenerateAllLocalizationFiles < CommandTest
def test_creates_output_folder
FileUtils.remove_entry_secure @output_dir
new_runner.generate_all_localization_files
assert File.exists? @output_dir
assert File.exist? @output_dir
end
def test_creates_language_folders
new_runner.generate_all_localization_files
assert File.exists?(File.join(@output_dir, 'en.lproj')), "language folder 'en.lproj' should be created"
assert File.exists?(File.join(@output_dir, 'es.lproj')), "language folder 'es.lproj' should be created"
assert File.exist?(File.join(@output_dir, 'en.lproj')), "language folder 'en.lproj' should be created"
assert File.exist?(File.join(@output_dir, 'es.lproj')), "language folder 'es.lproj' should be created"
end
def test_prints_empty_file_warnings

View file

@ -19,7 +19,7 @@ class TestGenerateLocalizationArchive < CommandTest
def test_generates_zip_file
new_runner.generate_localization_archive
assert File.exists?(@output_path), "zip file should exist"
assert File.exist?(@output_path), "zip file should exist"
end
def test_zip_file_structure

View file

@ -1,6 +1,6 @@
require 'erb'
require 'minitest/autorun'
require "mocha/mini_test"
require "mocha/minitest"
require 'securerandom'
require 'stringio'
require 'twine'
@ -23,7 +23,7 @@ class TwineTest < Minitest::Test
end
def teardown
FileUtils.remove_entry_secure @output_dir if File.exists? @output_dir
FileUtils.remove_entry_secure @output_dir if File.exist? @output_dir
Twine::Formatters.formatters.clear
Twine::Formatters.formatters.concat @formatters
super