Skip to content

Commit 446f6db

Browse files
justin808claude
andcommitted
Fix RSpec be_positive matcher syntax
RuboCop's auto-correction incorrectly changed 'be > 0' to 'be.positive?' which is invalid RSpec syntax. The correct syntax is 'be_positive' without the dot, as it's a direct matcher on the value, not a method on the be matcher. Fixes test failures: - NoMethodError: undefined method 'positive?' for RSpec::Matchers::BuiltIn::Be 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d9181c8 commit 446f6db

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

react_on_rails/spec/react_on_rails/generators/js_dependency_manager_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def errors
182182
result = instance.send(:install_js_dependencies)
183183

184184
expect(result).to be(false)
185-
expect(warnings.size).to be.positive?
185+
expect(warnings.size).to be_positive
186186
expect(warnings.first.to_s).to include("package_json not available")
187187
end
188188

@@ -192,7 +192,7 @@ def errors
192192
result = instance.send(:install_js_dependencies)
193193

194194
expect(result).to be(false)
195-
expect(warnings.size).to be.positive?
195+
expect(warnings.size).to be_positive
196196
expect(warnings.first.to_s).to include("JavaScript dependencies installation failed")
197197
end
198198
end
@@ -265,7 +265,7 @@ def errors
265265

266266
instance.send(:add_react_on_rails_package)
267267

268-
expect(warnings.size).to be.positive?
268+
expect(warnings.size).to be_positive
269269
expect(warnings.first.to_s).to include("Failed to add react-on-rails package")
270270
end
271271

@@ -274,7 +274,7 @@ def errors
274274

275275
instance.send(:add_react_on_rails_package)
276276

277-
expect(warnings.size).to be.positive?
277+
expect(warnings.size).to be_positive
278278
# When add_package catches exception, it returns false, triggering the "Failed to add" warning
279279
expect(warnings.first.to_s).to include("Failed to add react-on-rails package")
280280
end
@@ -291,7 +291,7 @@ def errors
291291

292292
instance.send(:add_react_dependencies)
293293

294-
expect(warnings.size).to be.positive?
294+
expect(warnings.size).to be_positive
295295
expect(warnings.first.to_s).to include("Failed to add React dependencies")
296296
end
297297
end
@@ -307,7 +307,7 @@ def errors
307307

308308
instance.send(:add_css_dependencies)
309309

310-
expect(warnings.size).to be.positive?
310+
expect(warnings.size).to be_positive
311311
expect(warnings.first.to_s).to include("Failed to add CSS dependencies")
312312
end
313313
end
@@ -336,7 +336,7 @@ def errors
336336

337337
instance.send(:add_dev_dependencies)
338338

339-
expect(warnings.size).to be.positive?
339+
expect(warnings.size).to be_positive
340340
expect(warnings.first.to_s).to include("Failed to add development dependencies")
341341
end
342342
end
@@ -352,7 +352,7 @@ def errors
352352

353353
instance.send(:add_rspack_dependencies)
354354

355-
expect(warnings.size).to be.positive?
355+
expect(warnings.size).to be_positive
356356
expect(warnings.first.to_s).to include("Failed to add Rspack dependencies")
357357
end
358358
end
@@ -369,7 +369,7 @@ def errors
369369

370370
instance.send(:add_typescript_dependencies)
371371

372-
expect(warnings.size).to be.positive?
372+
expect(warnings.size).to be_positive
373373
expect(warnings.first.to_s).to include("Failed to add TypeScript dependencies")
374374
end
375375
end
@@ -413,7 +413,7 @@ def errors
413413
expect { instance.send(:setup_js_dependencies) }.not_to raise_error
414414

415415
# Should have generated warnings for failures
416-
expect(warnings.size).to be.positive?
416+
expect(warnings.size).to be_positive
417417
# But no errors that would crash the generator
418418
expect(errors.size).to eq(0)
419419
end

0 commit comments

Comments
 (0)