aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/configurator_test.rb
blob: f8e4dccc9cfd7490f6547e4da35c8aefb8cc8b0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require "service/shared_service_tests"

class ActiveStorage::Service::ConfiguratorTest < ActiveSupport::TestCase
  test "builds correct service instance based on service name" do
    service = ActiveStorage::Service::Configurator.build(:foo, foo: { service: "Disk", root: "path" })
    assert_instance_of ActiveStorage::Service::DiskService, service
  end

  test "raises error when passing non-existent service name" do
    assert_raise RuntimeError do
      ActiveStorage::Service::Configurator.build(:bigfoot, {})
    end
  end
end