Forum: RSpec Custom matcher, use other helpers and matchers from rspec-rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F85bacbbd4814799d4526b3e35a431df?d=identicon&s=25 Brandon Olivares (Guest)
on 2009-04-13 03:18
(Received via mailing list)
Hi,

I am creating an improved version of route_for that is more intuitive to
me.
However, I keep getting NoMethodError exceptions, so am trying to find
all
the includes I have to put into my class.

What's the best way to import the necessary classes to use rspec-rails
assertions and helpers?

Brandon
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-13 03:29
(Received via mailing list)
On Sun, Apr 12, 2009 at 10:15 PM, Brandon Olivares
<programmer2188@gmail.com> wrote:
> Hi,
>
> I am creating an improved version of route_for that is more intuitive to me.
> However, I keep getting NoMethodError exceptions, so am trying to find all
> the includes I have to put into my class.
>
> What's the best way to import the necessary classes to use rspec-rails
> assertions and helpers?

There's not really a single mechanism for that at this point because
rspec-rails isn't really designed to be the basis for extensions of
itself.

Can you be more specific about which methods are not being found? Are
they all from rspec-rails? Are some from rails directly?
F85bacbbd4814799d4526b3e35a431df?d=identicon&s=25 Brandon Olivares (Guest)
on 2009-04-13 03:38
(Received via mailing list)
> itself.
>
> Can you be more specific about which methods are not being found? Are
> they all from rspec-rails? Are some from rails directly?
>

I can't remember everything, but first was route_for, so I included
Spec::Rails::Example::RoutingHelpers. Then assert_recognizes, and I
can't
remember exactly what I included for that at first. Then
clean_backtrace,
and I found the module for that, then build_message.

Then I gave up, and was trying to find a parent module that would just
include all of that, because it doesn't make sense I'd have to include
so
many different things to make it work.

Brandon
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-13 04:07
(Received via mailing list)
On Sun, Apr 12, 2009 at 10:35 PM, Brandon Olivares
<programmer2188@gmail.com> wrote:
>> There's not really a single mechanism for that at this point because
> and I found the module for that, then build_message.
>
> Then I gave up, and was trying to find a parent module that would just
> include all of that, because it doesn't make sense I'd have to include so
> many different things to make it work.

Yeah - unfortunately, you're kinda stuck with that for the moment cuz
there is no parent module. :(
This topic is locked and can not be replied to.