ruby / ruby/spec

Deprecate should_not raise_error in MSpec and replaces usages in ruby/spec

Open
#754 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Ruby
Stars
622
Forks
402
Avg merge
14h 51m
Merged PRs (30d)
6

Description

See https://github.com/ruby/spec/pull/753/files#r376792963

should_not raise_error is the same as testing nothing.
Each example already implicitly test no exception is raised.
There might be a few legit cases, but I would expect the vast majority could be removed and replaced with useful expectations actually testing it works as expected.

Currently there are about 176 should_not raise_error in ruby/spec.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the referenced ruby/spec pull request discussion and search the repository for the roughly 176 should_not raise_error usages. Separate legitimate exception checks from cases that only verify no exception, then replace or remove the latter with useful expectations. Done means the unnecessary usages are addressed and the MSpec behavior is deprecated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.