-
-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathconfiguration_spec.rb
More file actions
36 lines (31 loc) · 1.06 KB
/
configuration_spec.rb
File metadata and controls
36 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe RubyLLM::Configuration do
describe 'DSL defaults' do
subject(:config) { described_class.new }
it 'applies core default values' do
expect(config.model_registry_class).to eq('Model')
expect(config.use_new_acts_as).to be(false)
expect(config.request_timeout).to eq(300)
expect(config.max_retries).to eq(3)
expect(config.retry_interval).to eq(0.1)
expect(config.retry_backoff_factor).to eq(2)
expect(config.retry_interval_randomness).to eq(0.5)
end
it 'exposes a discoverable options API' do
expect(described_class.options).to include(
:request_timeout,
:default_model,
:model_registry_file,
:openai_api_key,
:openrouter_api_base
)
end
end
describe 'method redefinition warnings' do
it 'does not emit method redefined warning for log_regexp_timeout=' do
warnings = `#{RbConfig.ruby} -W -e 'require "ruby_llm"' 2>&1`
expect(warnings).not_to include('method redefined')
end
end
end