Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 18720bc

Browse files
dixpacDavid Heinemeier Hansson
authored andcommitted
Add basic tests to the Configurator#build (#28)
1 parent f2f5c79 commit 18720bc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/service/configurator_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require "service/shared_service_tests"
2+
3+
class ActiveStorage::Service::ConfiguratorTest < ActiveSupport::TestCase
4+
test "builds correct service instance based on service name" do
5+
service = ActiveStorage::Service::Configurator.build(:s3, SERVICE_CONFIGURATIONS)
6+
assert_instance_of ActiveStorage::Service::S3Service, service
7+
end
8+
9+
test "raises error when passing non-existent service name" do
10+
assert_raise RuntimeError do
11+
ActiveStorage::Service::Configurator.build(:bigfoot, SERVICE_CONFIGURATIONS)
12+
end
13+
end
14+
end
15+

0 commit comments

Comments
 (0)