spockframework / spockframework/spock

thrown() that takes an exception instance

Open
#397 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module-Core Type-Defect
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 275

It would be nice to have a following shortcut:

then:
def ex = thrown(Exception)
ex == expectedException

//shortcut:
then:
thrown(expectedException)

Reported by szczepiq on 2012-10-16 09:35:40

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

Start by locating the existing thrown(Exception) entry point and the tests covering exception assertions. Compare the requested thrown(expectedException) call with the current behavior, then update the relevant tests and implementation so the instance-based shortcut is supported and its equality behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.