|
12 | 12 | describe '.refresh!' do |
13 | 13 | context 'with default parameters' do # rubocop:disable RSpec/NestedGroups |
14 | 14 | it 'includes local providers' do |
15 | | - allow(described_class).to receive(:fetch_from_models_dev).and_return([]) |
16 | | - allow(RubyLLM::Provider).to receive(:configured_providers).and_return([]) |
| 15 | + allow(described_class).to receive(:fetch_models_dev_models).and_return({ models: [], fetched: true }) |
| 16 | + allow(RubyLLM::Provider).to receive_messages(providers: {}, configured_providers: []) |
17 | 17 |
|
18 | 18 | described_class.refresh! |
19 | 19 |
|
|
23 | 23 |
|
24 | 24 | context 'with remote_only: true' do # rubocop:disable RSpec/NestedGroups |
25 | 25 | it 'excludes local providers' do |
26 | | - allow(described_class).to receive(:fetch_from_models_dev).and_return([]) |
27 | | - allow(RubyLLM::Provider).to receive(:configured_remote_providers).and_return([]) |
| 26 | + allow(described_class).to receive(:fetch_models_dev_models).and_return({ models: [], fetched: true }) |
| 27 | + allow(RubyLLM::Provider).to receive_messages(remote_providers: {}, configured_remote_providers: []) |
28 | 28 |
|
29 | 29 | described_class.refresh!(remote_only: true) |
30 | 30 |
|
|
35 | 35 |
|
36 | 36 | describe '.fetch_from_providers' do |
37 | 37 | it 'defaults to remote_only: true' do |
38 | | - allow(RubyLLM::Provider).to receive(:configured_remote_providers).and_return([]) |
| 38 | + allow(RubyLLM::Provider).to receive_messages(remote_providers: {}, configured_remote_providers: []) |
39 | 39 |
|
40 | 40 | described_class.fetch_from_providers |
41 | 41 |
|
42 | 42 | expect(RubyLLM::Provider).to have_received(:configured_remote_providers) |
43 | 43 | end |
44 | 44 |
|
45 | 45 | it 'can include local providers with remote_only: false' do |
46 | | - allow(RubyLLM::Provider).to receive(:configured_providers).and_return([]) |
| 46 | + allow(RubyLLM::Provider).to receive_messages(providers: {}, configured_providers: []) |
47 | 47 |
|
48 | 48 | described_class.fetch_from_providers(remote_only: false) |
49 | 49 |
|
|
0 commit comments