Running One RSpec Example in RubyMine with Bundler Context
Forgetting bundle exec or the wrong line number breaks RSpec. RubyMine runs a single spec with the correct Bundler and Rails context automatically.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Forgetting bundle exec or the wrong line number breaks RSpec. RubyMine runs a single spec with the correct Bundler and Rails context automatically.
Extract repeated RSpec assertions into shared examples, but watch for hidden dependencies on let and subject.
RSpec stops at the first failing expectation by default. aggregate_failures lets you collect multiple related expectation failures per example without aborting early.
let is lazy and memoized per example; let! adds a before hook. How the mechanism works, where it bites, and a two-minute check to verify it in your suite.
Stop duplicating tests for common interfaces. Learn how to use RSpec shared_examples to define behavioral contracts once and enforce them across multiple classes.
Learn how to use RSpec's let and let! helpers to manage test dependencies, avoid state leakage, and optimize test suite performance through memoization.
Learn how to define RSpec shared examples once and reuse them across classes that implement the same interface, with parameterization, file organization, and debugging tips.
Use RSpec verifying doubles to catch stale mocks early. Compare instance_double, class_double, and object_double with validation steps.
Learn how to use RSpec’s tag filtering to run specific tests, skip slow ones, and focus on critical scenarios. The article covers inline tags, derived metadata, focused execution, and best‑practice trade‑offs.