[rspec-users] How to spec accessing a constant

Marcelo de Moraes Serpa celoserpa at gmail.com
Thu Feb 18 12:58:33 EST 2010


Why don't you open the class, and set the constant like so:

class TheClass
  CONSTANT = 'value_it_should_have_for_the_current_spec'
end

This worked for me.

Marcelo.

On Thu, Oct 16, 2008 at 7:24 PM, Nick Hoffman <nick at deadorange.com> wrote:

> On 2008-10-16, at 15:12, Craig Demyanovich wrote:
>
>> Cool. Having seen something a little more concrete, I like your design
>> decisions. In this case, I'd go with Scott's recommendation of hiding the
>> constant behind a method.
>>
>> Regards,
>> Craig
>>
>
> Thanks for taking a look, Craig, and giving me your opinion.
>
>
> Cheers,
> Nick
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100218/38850feb/attachment.html>


More information about the rspec-users mailing list