[rspec-users] How to intercept an instance method from StdLib (1.9.2)

Hedge Hog hedgehogshiatus at gmail.com
Fri Mar 4 00:45:27 EST 2011

I'm struggling with something that seems to be simple, and I've not
had any joy following the RSpec books suggestions (p. 187).
I'd like to test that a method raises and error when a file is not found.
I've tried adding this in my example just before I call my method, but
it never seems to get invoked.

The whole example:

    it "should raise an error if RVM's install root does not exist" do
       lambda{ B3::Bdd::Helpers.rvm_path}.should
raise_error(RuntimeError, "File not found:")

Appreciate any tips.

πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
  Archilochus, Greek poet (c. 680 BC – c. 645 BC)

More information about the rspec-users mailing list