Skip to content

Commit 88dd813

Browse files
committed
Respect example length rule
1 parent 95ff35b commit 88dd813

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ require: rubocop-rspec
33
AllCops:
44
TargetRubyVersion: 3.0
55

6-
RSpec/ExampleLength:
7-
Max: 18
8-
96
RSpec/NestedGroups:
107
Max: 4
118

spec/manifolds/services/big_query_service_spec.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@
4444

4545
it "includes the expected schema structure" do
4646
schema = JSON.parse(File.read(File.join(Dir.pwd, "projects", project_name, "bq", "tables", "dimensions.json")))
47-
expect(schema).to include(
48-
{
49-
"type" => "STRING",
50-
"name" => "id",
51-
"mode" => "REQUIRED"
52-
}
53-
)
47+
expect(schema).to include({ "type" => "STRING", "name" => "id", "mode" => "REQUIRED" })
5448
end
5549
end
5650

spec/manifolds/services/vector_service_spec.rb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66

77
describe "#load_vector_schema" do
88
let(:vector_name) { "page" }
9-
let(:vector_path) { "#{Dir.pwd}/vectors/page.yml" }
9+
let(:expected_schema) do
10+
{
11+
"name" => "page",
12+
"type" => "RECORD",
13+
"fields" => [
14+
{ "name" => "id", "type" => "STRING", "mode" => "NULLABLE" },
15+
{ "name" => "url", "type" => "STRING", "mode" => "NULLABLE" },
16+
{ "name" => "created_at", "type" => "TIMESTAMP", "mode" => "NULLABLE" }
17+
]
18+
}
19+
end
1020
let(:vector_config) do
1121
{
1222
"attributes" => {
@@ -18,27 +28,19 @@
1828
end
1929

2030
before do
31+
vector_path = File.join(Dir.pwd, "vectors", "#{vector_name}.yml")
2132
allow(File).to receive(:exist?).with(vector_path).and_return(true)
2233
allow(YAML).to receive(:load_file).with(vector_path).and_return(vector_config)
2334
end
2435

2536
it "loads and transforms vector schema" do
2637
schema = service.load_vector_schema(vector_name)
27-
expect(schema).to eq(
28-
{
29-
"name" => "page",
30-
"type" => "RECORD",
31-
"fields" => [
32-
{ "name" => "id", "type" => "STRING", "mode" => "NULLABLE" },
33-
{ "name" => "url", "type" => "STRING", "mode" => "NULLABLE" },
34-
{ "name" => "created_at", "type" => "TIMESTAMP", "mode" => "NULLABLE" }
35-
]
36-
}
37-
)
38+
expect(schema).to eq(expected_schema)
3839
end
3940

4041
context "when vector file doesn't exist" do
4142
before do
43+
vector_path = File.join(Dir.pwd, "vectors", "#{vector_name}.yml")
4244
allow(File).to receive(:exist?).with(vector_path).and_return(false)
4345
allow(logger).to receive(:error)
4446
end
@@ -48,6 +50,7 @@
4850
end
4951

5052
it "logs error" do
53+
vector_path = File.join(Dir.pwd, "vectors", "#{vector_name}.yml")
5154
service.load_vector_schema(vector_name)
5255
expect(logger).to have_received(:error)
5356
.with("Vector configuration not found: #{vector_path}")

0 commit comments

Comments
 (0)