Skip to content

Commit b9e49ac

Browse files
committed
damn you rubocop
1 parent c5fb79c commit b9e49ac

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/v8_mapper_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def extract_number_of_results code_mapper, response_body
118118
response_body = response_body.join("\n") if response_body.is_a?(Array)
119119

120120
# If responseBody is a JSON string, parse it first before converting to JavaScript
121-
begin
121+
begin
122122
parsed_body = JSON.parse(response_body)
123123
@context.eval("var responseBody = #{parsed_body.to_json};")
124124
rescue JSON::ParserError

test/services/v8_mapper_executor_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,30 +187,30 @@ class V8MapperExecutorTest < ActiveSupport::TestCase
187187
# Simulate a JSON response from Vespa or similar API
188188
json_response = {
189189
root: {
190-
id: 'toplevel',
190+
id: 'toplevel',
191191
relevance: 1,
192-
fields: { totalCount: 2 },
193-
children: [
192+
fields: { totalCount: 2 },
193+
children: [
194194
{
195-
id: 'doc1',
195+
id: 'doc1',
196196
relevance: 0.95,
197-
fields: { title: 'First Document', content: 'Content here' }
197+
fields: { title: 'First Document', content: 'Content here' },
198198
},
199199
{
200-
id: 'doc2',
200+
id: 'doc2',
201201
relevance: 0.85,
202-
fields: { title: 'Second Document', content: 'More content' }
202+
fields: { title: 'Second Document', content: 'More content' },
203203
}
204-
]
205-
}
204+
],
205+
},
206206
}.to_json
207207

208208
# Extract documents
209209
docs = v8_executor.extract_docs(code_mapper, json_response)
210210
assert_equal 2, docs.length
211211
assert_equal 'doc1', docs[0]['id']
212212
assert_equal 'First Document', docs[0]['title']
213-
assert_equal 0.95, docs[0]['relevance']
213+
assert_in_delta(0.95, docs[0]['relevance'])
214214

215215
# Extract number of results
216216
num_results = v8_executor.extract_number_of_results(code_mapper, json_response)

0 commit comments

Comments
 (0)