Skip to content

Commit 398ef9b

Browse files
committed
Trying to fix ci errors
1 parent 3b6afdc commit 398ef9b

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

spec/ruby_llm/models_local_refresh_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
describe '.refresh!' do
1313
context 'with default parameters' do # rubocop:disable RSpec/NestedGroups
1414
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: [])
1717

1818
described_class.refresh!
1919

@@ -23,8 +23,8 @@
2323

2424
context 'with remote_only: true' do # rubocop:disable RSpec/NestedGroups
2525
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: [])
2828

2929
described_class.refresh!(remote_only: true)
3030

@@ -35,15 +35,15 @@
3535

3636
describe '.fetch_from_providers' do
3737
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: [])
3939

4040
described_class.fetch_from_providers
4141

4242
expect(RubyLLM::Provider).to have_received(:configured_remote_providers)
4343
end
4444

4545
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: [])
4747

4848
described_class.fetch_from_providers(remote_only: false)
4949

spec/ruby_llm/models_refresh_spec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@
8282
describe 'refresh models output structure' do
8383
before do
8484
# Mock the API responses to ensure consistent test results
85-
allow(described_class).to receive_messages(fetch_from_providers: mock_provider_models,
86-
fetch_from_models_dev: [])
85+
allow(described_class).to receive_messages(
86+
fetch_provider_models: {
87+
models: mock_provider_models,
88+
fetched_providers: mock_provider_models.map(&:provider).uniq,
89+
configured_names: [],
90+
failed: []
91+
},
92+
fetch_models_dev_models: { models: [], fetched: true }
93+
)
8794
end
8895

8996
let(:mock_provider_models) do

spec/ruby_llm/models_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,15 @@
111111

112112
describe '#refresh!' do
113113
before do
114-
allow(described_class).to receive(:fetch_from_models_dev).and_return([])
114+
allow(described_class).to receive_messages(
115+
fetch_provider_models: {
116+
models: [],
117+
fetched_providers: [],
118+
configured_names: [],
119+
failed: []
120+
},
121+
fetch_models_dev_models: { models: [], fetched: true }
122+
)
115123
end
116124

117125
it 'updates models and returns a chainable Models instance' do

0 commit comments

Comments
 (0)