[rspec-users] A better way to stub out constants
Ashley Moran
work at ashleymoran.me.uk
Wed Oct 31 20:29:21 EDT 2007
On Oct 31, 2007, at 9:59 pm, Shane Mingins wrote:
> Similar to my MiddleMan stub .... I used
>
> class Object; remove_const :MiddleMan; end
>
> Not sure how kosha it is?
Hi Shane
That was my actually my solution in the end, but I didn't post back to
the list. To be honest, I don't think anything that messes with the
global namespace is kosha, but I guess it's something we've got to
live with. (You often have to do worse stuff to test Rails, which
makes me feel better.)
I actually summarised the few steps I needed to take on my blog:
<http://aviewfromafar.net/2007/10/31/specifying-dynamic-gem-usage-with-rspec
>
Quite why I thought it was interesting enough to tell the google bots
but not interesting enough to tell the RSpec list, I don't know...
Cheers
Ashley
--
blog @ http://aviewfromafar.net/
linked-in @ http://www.linkedin.com/in/ashleymoran
currently @ home
More information about the rspec-users
mailing list