Skip to content

Commit bbb2061

Browse files
committed
Removed unnecessary rubocop disable comments after last commit
1 parent e544397 commit bbb2061

19 files changed

+112
-112
lines changed

spec/ruby_llm/active_record/acts_as_attachment_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def uploaded_file(path, type)
3232
end
3333

3434
describe 'attachment handling' do
35-
it 'converts ActiveStorage attachments to RubyLLM Content' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
35+
it 'converts ActiveStorage attachments to RubyLLM Content' do
3636
chat = Chat.create!(model_id: model)
3737

3838
message = chat.messages.create!(role: 'user', content: 'Check this out')
@@ -47,7 +47,7 @@ def uploaded_file(path, type)
4747
expect(llm_message.content.attachments.first.mime_type).to eq('image/png')
4848
end
4949

50-
it 'handles multiple attachments' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
50+
it 'handles multiple attachments' do
5151
chat = Chat.create!(model_id: model)
5252

5353
image_upload = uploaded_file(image_path, 'image/png')
@@ -60,7 +60,7 @@ def uploaded_file(path, type)
6060
expect(response.content).to be_present
6161
end
6262

63-
it 'handles attachments in ask method' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
63+
it 'handles attachments in ask method' do
6464
chat = Chat.create!(model_id: model)
6565

6666
image_upload = uploaded_file(image_path, 'image/png')
@@ -74,7 +74,7 @@ def uploaded_file(path, type)
7474
end
7575

7676
describe 'attachment types' do
77-
it 'handles images' do # rubocop:disable RSpec/ExampleLength
77+
it 'handles images' do
7878
chat = Chat.create!(model_id: model)
7979
message = chat.messages.create!(role: 'user', content: 'Image test')
8080

@@ -89,7 +89,7 @@ def uploaded_file(path, type)
8989
expect(attachment.type).to eq(:image)
9090
end
9191

92-
it 'handles PDFs' do # rubocop:disable RSpec/ExampleLength
92+
it 'handles PDFs' do
9393
chat = Chat.create!(model_id: model)
9494
message = chat.messages.create!(role: 'user', content: 'PDF test')
9595

spec/ruby_llm/active_record/acts_as_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def execute(expression:)
2020

2121
# Basic functionality tests using dummy app models
2222
describe 'basic chat functionality' do
23-
it 'persists chat history' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
23+
it 'persists chat history' do
2424
chat = Chat.create!(model_id: model)
2525
chat.ask("What's your favorite Ruby feature?")
2626

@@ -33,7 +33,7 @@ def execute(expression:)
3333
expect(chat.updated_at).to eq(chat.messages.last.chat.updated_at)
3434
end
3535

36-
it 'tracks token usage' do # rubocop:disable RSpec/MultipleExpectations
36+
it 'tracks token usage' do
3737
chat = Chat.create!(model_id: 'gpt-4.1-nano')
3838
chat.ask('Hello')
3939

@@ -44,15 +44,15 @@ def execute(expression:)
4444
end
4545

4646
describe 'system messages' do
47-
it 'persists system messages' do # rubocop:disable RSpec/MultipleExpectations
47+
it 'persists system messages' do
4848
chat = Chat.create!(model_id: model)
4949
chat.with_instructions('You are a Ruby expert')
5050

5151
expect(chat.messages.first.role).to eq('system')
5252
expect(chat.messages.first.content).to eq('You are a Ruby expert')
5353
end
5454

55-
it 'replaces system messages when requested' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
55+
it 'replaces system messages when requested' do
5656
chat = Chat.create!(model_id: model)
5757

5858
chat.with_instructions('Be helpful')
@@ -66,7 +66,7 @@ def execute(expression:)
6666
end
6767

6868
describe 'tool usage' do
69-
it 'persists tool calls' do # rubocop:disable RSpec/MultipleExpectations
69+
it 'persists tool calls' do
7070
chat = Chat.create!(model_id: model)
7171
chat.with_tool(Calculator)
7272

@@ -95,7 +95,7 @@ def execute(expression:)
9595
end
9696

9797
describe 'structured output' do
98-
it 'supports with_schema for structured responses' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
98+
it 'supports with_schema for structured responses' do
9999
chat = Chat.create!(model_id: model)
100100

101101
schema = {
@@ -132,7 +132,7 @@ def execute(expression:)
132132
end
133133

134134
describe 'error handling' do
135-
it 'destroys empty assistant messages on API failure' do # rubocop:disable RSpec/MultipleExpectations
135+
it 'destroys empty assistant messages on API failure' do
136136
chat = Chat.create!(model_id: model)
137137

138138
# Stub the API to fail
@@ -210,7 +210,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
210210
end
211211

212212
describe 'namespaced chat models' do
213-
it 'works with namespaced classes and custom associations' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
213+
it 'works with namespaced classes and custom associations' do
214214
bot_chat = Assistants::BotChat.create!(model_id: model)
215215
bot_chat.ask("What's 2 + 2?")
216216

@@ -221,7 +221,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
221221
expect(bot_chat.messages.last.content).to be_present
222222
end
223223

224-
it 'persists tool calls with custom classes' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
224+
it 'persists tool calls with custom classes' do
225225
bot_chat = Assistants::BotChat.create!(model_id: model)
226226
bot_chat.with_tool(Calculator)
227227

@@ -233,7 +233,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
233233
expect(tool_call_message.tool_calls.first).to be_a(BotToolCall)
234234
end
235235

236-
it 'handles system messages correctly' do # rubocop:disable RSpec/MultipleExpectations
236+
it 'handles system messages correctly' do
237237
bot_chat = Assistants::BotChat.create!(model_id: model)
238238
bot_chat.with_instructions('You are a helpful bot')
239239

@@ -252,7 +252,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
252252
end
253253

254254
describe 'to_llm conversion' do
255-
it 'correctly converts custom messages to RubyLLM format' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
255+
it 'correctly converts custom messages to RubyLLM format' do
256256
bot_chat = Assistants::BotChat.create!(model_id: model)
257257
bot_message = bot_chat.messages.create!(
258258
role: 'user',
@@ -269,7 +269,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
269269
expect(llm_message.output_tokens).to eq(20)
270270
end
271271

272-
it 'correctly converts tool calls' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
272+
it 'correctly converts tool calls' do
273273
bot_chat = Assistants::BotChat.create!(model_id: model)
274274
bot_message = bot_chat.messages.create!(role: 'assistant', content: 'I need to calculate something')
275275

@@ -317,7 +317,7 @@ def uploaded_file(path, type)
317317
)
318318
end
319319

320-
it 'converts ActiveStorage attachments to RubyLLM Content' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
320+
it 'converts ActiveStorage attachments to RubyLLM Content' do
321321
chat = Chat.create!(model_id: model)
322322

323323
message = chat.messages.create!(role: 'user', content: 'Check this out')
@@ -332,7 +332,7 @@ def uploaded_file(path, type)
332332
expect(llm_message.content.attachments.first.mime_type).to eq('image/png')
333333
end
334334

335-
it 'handles multiple attachments' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
335+
it 'handles multiple attachments' do
336336
chat = Chat.create!(model_id: model)
337337

338338
image_upload = uploaded_file(image_path, 'image/png')
@@ -345,7 +345,7 @@ def uploaded_file(path, type)
345345
expect(response.content).to be_present
346346
end
347347

348-
it 'handles attachments in ask method' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
348+
it 'handles attachments in ask method' do
349349
chat = Chat.create!(model_id: model)
350350

351351
image_upload = uploaded_file(image_path, 'image/png')
@@ -358,7 +358,7 @@ def uploaded_file(path, type)
358358
end
359359

360360
describe 'attachment types' do
361-
it 'handles images' do # rubocop:disable RSpec/ExampleLength
361+
it 'handles images' do
362362
chat = Chat.create!(model_id: model)
363363
message = chat.messages.create!(role: 'user', content: 'Image test')
364364

@@ -373,7 +373,7 @@ def uploaded_file(path, type)
373373
expect(attachment.type).to eq(:image)
374374
end
375375

376-
it 'handles PDFs' do # rubocop:disable RSpec/ExampleLength
376+
it 'handles PDFs' do
377377
chat = Chat.create!(model_id: model)
378378
message = chat.messages.create!(role: 'user', content: 'PDF test')
379379

spec/ruby_llm/active_record/acts_as_with_context_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
RubyLLM.instance_variable_set(:@config, original_config)
2020
end
2121

22-
it 'works when using chat with a custom context' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
22+
it 'works when using chat with a custom context' do
2323
chat = Chat.create!(model_id: model)
2424

2525
# Create a custom context with API key
@@ -55,7 +55,7 @@
5555
describe 'with global configuration present' do
5656
include_context 'with configured RubyLLM'
5757

58-
it 'works with custom context even when global config exists' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
58+
it 'works with custom context even when global config exists' do
5959
chat = Chat.create!(model_id: model)
6060

6161
# Create a different API key in custom context

spec/ruby_llm/chat_assume_model_exists_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
end.to raise_error(ArgumentError, /Provider must be specified/)
2424
end
2525

26-
it 'skips registry validation when assuming model exists' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
26+
it 'skips registry validation when assuming model exists' do
2727
expect(RubyLLM::Models).not_to receive(:find) # rubocop:disable RSpec/MessageSpies
2828

2929
chat = described_class.new(
@@ -36,7 +36,7 @@
3636
expect(chat.model.provider).to eq(provider)
3737
end
3838

39-
it 'works with RubyLLM.chat convenience method' do # rubocop:disable RSpec/ExampleLength
39+
it 'works with RubyLLM.chat convenience method' do
4040
chat = RubyLLM.chat(
4141
model: custom_model,
4242
provider: provider,
@@ -46,7 +46,7 @@
4646
expect(chat.model.id).to eq(custom_model)
4747
end
4848

49-
it 'works with models not in registry but available in API' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
49+
it 'works with models not in registry but available in API' do
5050
# Simulate model missing from registry
5151
filtered_models = original_models.reject { |m| m.id == real_model }
5252
RubyLLM::Models.instance.instance_variable_set(:@models, filtered_models)
@@ -68,7 +68,7 @@
6868
expect(response.content).to include('4')
6969
end
7070

71-
it 'works with with_model method' do # rubocop:disable RSpec/MultipleExpectations
71+
it 'works with with_model method' do
7272
chat = RubyLLM.chat
7373

7474
chat.with_model(custom_model, provider: provider, assume_exists: true)

spec/ruby_llm/chat_content_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
CHAT_MODELS.each do |model_info|
2323
model = model_info[:model]
2424
provider = model_info[:provider]
25-
it "#{provider}/#{model} can understand text" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
25+
it "#{provider}/#{model} can understand text" do
2626
chat = RubyLLM.chat(model: model, provider: provider)
2727
response = chat.ask("What's in this file?", with: text_path)
2828

@@ -41,7 +41,7 @@
4141
expect(chat.messages[2].content.attachments.first.mime_type).to eq('application/xml')
4242
end
4343

44-
it "#{provider}/#{model} can understand remote text" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
44+
it "#{provider}/#{model} can understand remote text" do
4545
chat = RubyLLM.chat(model: model, provider: provider)
4646
response = chat.ask("What's in this file?", with: text_url)
4747

@@ -58,7 +58,7 @@
5858
VISION_MODELS.each do |model_info|
5959
model = model_info[:model]
6060
provider = model_info[:provider]
61-
it "#{provider}/#{model} can understand local images" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
61+
it "#{provider}/#{model} can understand local images" do
6262
chat = RubyLLM.chat(model: model, provider: provider)
6363
response = chat.ask('What do you see in this image?', with: { image: image_path })
6464

@@ -69,7 +69,7 @@
6969
expect(chat.messages.first.content.attachments.first.mime_type).to eq('image/png')
7070
end
7171

72-
it "#{provider}/#{model} can understand remote images without extension" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
72+
it "#{provider}/#{model} can understand remote images without extension" do
7373
chat = RubyLLM.chat(model: model, provider: provider)
7474
response = chat.ask('What do you see in this image?', with: image_url_no_ext)
7575

@@ -82,7 +82,7 @@
8282
end
8383
model = VISION_MODELS.first[:model]
8484
provider = VISION_MODELS.first[:provider]
85-
it "return errors when content doesn't exist" do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
85+
it "return errors when content doesn't exist" do
8686
chat = RubyLLM.chat(model: model, provider: provider)
8787
expect do
8888
chat.ask('What do you see in this image?', with: bad_image_url)
@@ -99,7 +99,7 @@
9999
AUDIO_MODELS.each do |model_info|
100100
model = model_info[:model]
101101
provider = model_info[:provider]
102-
it "#{provider}/#{model} can understand audio" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
102+
it "#{provider}/#{model} can understand audio" do
103103
chat = RubyLLM.chat(model: model, provider: provider)
104104
response = chat.ask('What is being said?', with: { audio: audio_path })
105105

@@ -116,7 +116,7 @@
116116
PDF_MODELS.each do |model_info|
117117
model = model_info[:model]
118118
provider = model_info[:provider]
119-
it "#{provider}/#{model} understands PDFs" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
119+
it "#{provider}/#{model} understands PDFs" do
120120
chat = RubyLLM.chat(model: model, provider: provider)
121121
response = chat.ask('Summarize this document', with: { pdf: pdf_path })
122122
expect(response.content).not_to be_empty
@@ -128,7 +128,7 @@
128128
expect(response.content).not_to be_empty
129129
end
130130

131-
it "#{provider}/#{model} handles multiple PDFs" do # rubocop:disable RSpec/MultipleExpectations,RSpec/ExampleLength
131+
it "#{provider}/#{model} handles multiple PDFs" do
132132
chat = RubyLLM.chat(model: model, provider: provider)
133133
# Using same file twice for testing
134134
response = chat.ask('Compare these documents', with: [pdf_path, pdf_url])
@@ -143,7 +143,7 @@
143143
expect(response.content).not_to be_empty
144144
end
145145

146-
it "#{provider}/#{model} can handle array of mixed files with auto-detection" do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
146+
it "#{provider}/#{model} can handle array of mixed files with auto-detection" do
147147
chat = RubyLLM.chat(model: model, provider: provider)
148148
response = chat.ask('Analyze these files', with: [image_path, pdf_path])
149149

@@ -164,14 +164,14 @@
164164
expect(attachment.mime_type).to be_present
165165
end
166166

167-
it 'creates content with URL attachments' do # rubocop:disable RSpec/MultipleExpectations
167+
it 'creates content with URL attachments' do
168168
content = RubyLLM::Content.new('Describe this image', image_url)
169169

170170
expect(content.attachments).not_to be_empty
171171
expect(content.attachments.first).to be_a(RubyLLM::Attachment)
172172
end
173173

174-
it 'prevents ArgumentError: wrong number of arguments when processing URL attachments' do # rubocop:disable RSpec/MultipleExpectations
174+
it 'prevents ArgumentError: wrong number of arguments when processing URL attachments' do
175175
require 'open-uri' # required to trigger the marcel/open-uri compatibility issue
176176

177177
attachment = RubyLLM::Attachment.new(image_url)

spec/ruby_llm/chat_error_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
end
4444
end
4545

46-
it 'raises appropriate auth error' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
46+
it 'raises appropriate auth error' do
4747
skip('Only valid for remote providers') if RubyLLM::Provider.providers[provider].local?
4848
expect { chat.ask('Hello') }.to raise_error do |error|
4949
expect(error).to be_a(RubyLLM::Error)
@@ -67,7 +67,7 @@
6767
context "#{provider}/#{model}" do # rubocop:disable RSpec/ContextWording
6868
let(:chat) { RubyLLM.chat(model: model, provider: provider) }
6969

70-
it 'handles context length exceeded errors' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
70+
it 'handles context length exceeded errors' do
7171
if RubyLLM::Provider.providers[provider]&.local?
7272
skip('Local providers do not throw an error for context length exceeded')
7373
end

0 commit comments

Comments
 (0)