RSpec does not do any constant autoloading so if you're getting and
uninitialized constant error but the constant is defined in a file, it
means that file hasn't been loaded yet.  The simple solution is to
`require` the file.

HTH,
Myron

On Sat, Sep 26, 2015 at 4:46 AM, Igor Yurchenko <[email protected]>
wrote:

> Hi, ppl...
>
> I need help with setting up rails evironment for rspec. I've created some
> code on lib/backup/status.rb path and matched specs at
> spec/lib/backup/status_spec.rb.
>
> The problem is the spec does not see Backup::Status constant defined at
> lib/backup/status.rb...
>
>
> Row "RSpec.describe Backup::Status do end" in spec/lib/backup/status.rb
> causes error:
> /home/space/devel/sole/sola/spec/lib/backup/status_spec.rb:4:in `<top
> (required)>': uninitialized constant Backup (NameError)
>
> Thanks in advance...
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rspec/49a5a495-cc57-4906-b69f-b3589319cc7b%40googlegroups.com
> <https://groups.google.com/d/msgid/rspec/49a5a495-cc57-4906-b69f-b3589319cc7b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CADUxQmvqj-vx1By8gxfhPbLQHCk7Ww3XCZ6w19hgU7GC4mweUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to