Skip to content

Commit c1e5c25

Browse files
committed
Fix custom adapter spec.
1 parent 9278ef4 commit c1e5c25

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

spec/do_snapshot/adapter_spec.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
RSpec.describe DoSnapshot::Adapter do
55
include_context 'environment'
66

7-
module AdapterFactory
8-
class Adapter # rubocop:disable Style/Documentation
9-
def initialize(_ = {}); end
7+
module DoSnapshot
8+
module Adapter
9+
class CustomAdapter # rubocop:disable Style/Documentation
10+
def initialize(_ = {}); end
11+
end
1012
end
1113
end
1214

@@ -19,8 +21,12 @@ def initialize(_ = {}); end
1921
end
2022

2123
it 'when custom adapter' do
22-
api = adapter.api('AdapterFactory::Adapter')
23-
expect(api).to be_a_kind_of(AdapterFactory::Adapter)
24+
api = adapter.api('CustomAdapter')
25+
expect(api).to be_a_kind_of(DoSnapshot::Adapter::CustomAdapter)
26+
end
27+
28+
it 'when wrong custom adapter' do
29+
expect { adapter.api('CustomAdapter2') }.to raise_exception(DoSnapshot::NoProtocolError)
2430
end
2531

2632
it 'when error' do

0 commit comments

Comments
 (0)