• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rspec / rspec-mocks / 681
63%

Build:
DEFAULT BRANCH: master
Ran 20 Jun 2013 12:42PM UTC
Jobs 4
Files 32
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
681

Pull #315

travis-ci

myronmarston
Clarify relationship between different method stub actions.

In 2.13.0 only `and_yield` and `and_return` could be combined, since
that was the only combination case that was specified by an example.
This was a regression, as reported by a user in #230.

I tried here to fully specify all of the various combinations of stub 
actions. Notes:

* `and_return`, `and_raise` and `and_throw` are "terminal" actions
  in the sense that they terminate the method. They _must_ happen last
  and it is impossible to support more than one of these. Hence, we allow
  only one of these, and allow them to be overridden. We also return `nil`
  from these methods to discourage further stub configuration.
* `and_call_original` is a special case that doesn't make sense to be
  combined with any of the others. Once you've set it up, this causes
  any further instructions to raise an error.
* `and_yield` is treated as an "initial" action. Yielding doesn't exit
  a method the way the terminal actions do. It is the only initial action.
  Calling it multiple times sets up multiple yields.
* Setting a block implementation (possible by passing a block to almost
  any method on the fluent interface) sets the block as the "inner" action.
  It runs between the configured yields (if there are any) and the configured
  terminal action (if there is one). My thinking here is that in many cases,
  users use a block implementation to specify a return value, essentially
  making it like a terminal action (so it should come after the `and_yield`
  actions), but in other cases, the user may just use a block for a side
  effect, and may configure an terminal action as well. Only one block
  implementation is supported and it can be overridden.
Pull Request #315: Reapply 243 onto master

61 of 61 new or added lines in 1 file covered. (100.0%)

1636 of 1681 relevant lines covered (97.32%)

387.59 hits per line

Jobs
ID Job ID Ran Files Coverage
3 681.3 (1.9.3) 20 Jun 2013 12:42PM UTC 0
97.55
Travis Job 681.3
6 681.6 (jruby-19mode) 20 Jun 2013 12:45PM UTC 0
95.71
Travis Job 681.6
8 681.8 (rbx-19mode) 20 Jun 2013 12:47PM UTC 0
99.44
Travis Job 681.8
9 681.9 (2.0.0) 20 Jun 2013 12:46PM UTC 0
97.55
Travis Job 681.9
Source Files on build 681
  • Tree
  • List 0
  • Changed 70
  • Source Changed 4
  • Coverage Changed 70
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #681
  • Pull Request #315
  • PR Base - master (#677)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc