[rspec-users] Cucumber namespace problem

aslak hellesoy aslak.hellesoy at gmail.com
Fri Jan 2 13:34:58 EST 2009


On Fri, Jan 2, 2009 at 7:20 PM, Emmanuel Pinault <seatmanu at gmail.com> wrote:

> Hi
>
> I am having an issue with Cucumber where I am writing in one files some
> steps where rspec matcher do not seem to be accessible.
>
> So I have a file with my steps  written like this
>
> require 'steputils'
>
> Given "some step description 1 " do
>        SomeClass.post(args)
> end
>
> Given "some step description 2 that is slighty different for better
> readability "  do
>        SomeClass.post(args)
> end
>
>
> and in steputils I have
>
> class Steputils
>
>        def self.post(args)
>                args.should_not be_empty
>        end
> end
>
>
> But the code breaks when trying to run args.should_not be_empty that are
> valid rspec matchers.. Seems like it is not recognizing it. I tried to
> include Cucumber and Spec as part of my class


Please post the full error message and backtrace.

Did you require 'spec' in your support/env.rb file?

Aslak


>
> but still not working. Any idea what I need to do to make it work? This
> will help refactoring some of the steps that may have similar code
>
> Also, is there a way to see all the existing step using the cucumber
> methods? because when you have a lot it would be nice to have a way to
> describe them for documentation purpose (like  Rake does for task)
>
> Thanks
>
> Emmanuel
>
>
>
>
>
> _______________________________________________
> 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/20090102/0ebdf758/attachment.html>


More information about the rspec-users mailing list