diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2017-07-09 04:23:21 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2017-07-09 04:46:59 -0700 |
commit | 4d292fc0e75e35e177806b1ea821455fc0bc021c (patch) | |
tree | 6d81c06d71b8a6428a3b6edceb334fdb9ea6cabb /test | |
parent | 1a17cfb9d9719c8458fb1259371c173627b96d8f (diff) | |
download | rails-4d292fc0e75e35e177806b1ea821455fc0bc021c.tar.gz rails-4d292fc0e75e35e177806b1ea821455fc0bc021c.tar.bz2 rails-4d292fc0e75e35e177806b1ea821455fc0bc021c.zip |
Clarify how a service can build other composed services
* Service.build takes the literal YAML config hash for the service and a
reference to the Configurator that's doing the building.
* Services that compose additional services can use the Configurator to
look them up and build them by name. See MirrorService for an example.
References #23
Diffstat (limited to 'test')
-rw-r--r-- | test/service/disk_service_test.rb | 2 | ||||
-rw-r--r-- | test/test_helper.rb | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/test/service/disk_service_test.rb b/test/service/disk_service_test.rb index bd2e68277e..94df146024 100644 --- a/test/service/disk_service_test.rb +++ b/test/service/disk_service_test.rb @@ -2,7 +2,7 @@ require "tmpdir" require "service/shared_service_tests" class ActiveStorage::Service::DiskServiceTest < ActiveSupport::TestCase - SERVICE = ActiveStorage::Service.configure(:test, test: { service: "Disk", root: File.join(Dir.tmpdir, "active_storage") }) + SERVICE = ActiveStorage::Service::DiskService.new(root: File.join(Dir.tmpdir, "active_storage")) include ActiveStorage::Service::SharedServiceTests end diff --git a/test/test_helper.rb b/test/test_helper.rb index b374a777dd..e24c45f656 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,9 +5,8 @@ require "active_support/testing/autorun" require "byebug" require "active_storage" - -require "active_storage/service" -ActiveStorage::Blob.service = ActiveStorage::Service.configure(:test, test: { service: 'Disk', root: File.join(Dir.tmpdir, "active_storage") }) +require "active_storage/service/disk_service" +ActiveStorage::Blob.service = ActiveStorage::Service::DiskService.new(root: File.join(Dir.tmpdir, "active_storage")) require "active_storage/verified_key_with_expiration" ActiveStorage::VerifiedKeyWithExpiration.verifier = ActiveSupport::MessageVerifier.new("Testing") |