-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Changit::ConfigLoader to ConfigReader
- Loading branch information
Showing
2 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
require 'test_helper' | ||
require 'changit/config_loader' | ||
require 'changit/config_reader' | ||
require 'tempfile' | ||
|
||
class ConfigLoaderTest < Minitest::Test | ||
def test_load | ||
class ConfigReaderTest < Minitest::Test | ||
def test_read | ||
file_contents = "[user]\n\tname = testname\n\temail = [email protected]\n[core]\n\teditor = vim\n[color]\n\tui = true\n[rebase]\n\tautosquash = true\n".freeze | ||
|
||
Tempfile.open('.gitconfig') do |f| | ||
f.write file_contents | ||
f.close | ||
|
||
assert Changit::ConfigLoader.new(search_path: f).load == file_contents | ||
assert Changit::ConfigReader.new(search_path: f).read == file_contents | ||
end | ||
end | ||
|
||
def test_load_file_not_found | ||
assert_raises(RuntimeError, "File #{config_loader.search_path} not found.") do | ||
config_loader.load | ||
def test_read_file_not_found | ||
assert_raises(RuntimeError, "File #{config_reader.search_path} not found.") do | ||
config_reader.read | ||
end | ||
end | ||
|
||
private | ||
|
||
def config_loader | ||
Changit::ConfigLoader.new | ||
def config_reader | ||
Changit::ConfigReader.new | ||
end | ||
end |