From c96fc66e8cad39ddd367f392c35c78d0e5a69803 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sat, 26 Jun 2021 12:45:41 +0900 Subject: [PATCH] Use file_fixture to load YAML files in Redmine::ConfigurationTest --- .../configuration/default.yml} | 0 .../configuration/empty.yml} | 0 .../configuration/no_default.yml} | 0 .../configuration/overrides.yml} | 0 test/unit/lib/redmine/configuration_test.rb | 12 ++++++------ 5 files changed, 6 insertions(+), 6 deletions(-) rename test/fixtures/{configuration/default.yml.example => files/configuration/default.yml} (100%) rename test/fixtures/{configuration/empty.yml.example => files/configuration/empty.yml} (100%) rename test/fixtures/{configuration/no_default.yml.example => files/configuration/no_default.yml} (100%) rename test/fixtures/{configuration/overrides.yml.example => files/configuration/overrides.yml} (100%) diff --git a/test/fixtures/configuration/default.yml.example b/test/fixtures/files/configuration/default.yml similarity index 100% rename from test/fixtures/configuration/default.yml.example rename to test/fixtures/files/configuration/default.yml diff --git a/test/fixtures/configuration/empty.yml.example b/test/fixtures/files/configuration/empty.yml similarity index 100% rename from test/fixtures/configuration/empty.yml.example rename to test/fixtures/files/configuration/empty.yml diff --git a/test/fixtures/configuration/no_default.yml.example b/test/fixtures/files/configuration/no_default.yml similarity index 100% rename from test/fixtures/configuration/no_default.yml.example rename to test/fixtures/files/configuration/no_default.yml diff --git a/test/fixtures/configuration/overrides.yml.example b/test/fixtures/files/configuration/overrides.yml similarity index 100% rename from test/fixtures/configuration/overrides.yml.example rename to test/fixtures/files/configuration/overrides.yml diff --git a/test/unit/lib/redmine/configuration_test.rb b/test/unit/lib/redmine/configuration_test.rb index b33de6e43..2647fb7b8 100644 --- a/test/unit/lib/redmine/configuration_test.rb +++ b/test/unit/lib/redmine/configuration_test.rb @@ -25,26 +25,26 @@ class Redmine::ConfigurationTest < ActiveSupport::TestCase end def test_empty - assert_kind_of Hash, load_conf('empty.yml.example', 'test') + assert_kind_of Hash, load_conf('empty.yml', 'test') end def test_default - assert_kind_of Hash, load_conf('default.yml.example', 'test') + assert_kind_of Hash, load_conf('default.yml', 'test') assert_equal 'foo', @conf['somesetting'] end def test_no_default - assert_kind_of Hash, load_conf('no_default.yml.example', 'test') + assert_kind_of Hash, load_conf('no_default.yml', 'test') assert_equal 'foo', @conf['somesetting'] end def test_overrides - assert_kind_of Hash, load_conf('overrides.yml.example', 'test') + assert_kind_of Hash, load_conf('overrides.yml', 'test') assert_equal 'bar', @conf['somesetting'] end def test_with - load_conf('default.yml.example', 'test') + load_conf('default.yml', 'test') assert_equal 'foo', @conf['somesetting'] @conf.with 'somesetting' => 'bar' do assert_equal 'bar', @conf['somesetting'] @@ -56,7 +56,7 @@ class Redmine::ConfigurationTest < ActiveSupport::TestCase def load_conf(file, env) @conf.load( - :file => File.join(Rails.root, 'test', 'fixtures', 'configuration', file), + :file => file_fixture(File.join('configuration', file)), :env => env ) end -- 2.31.1