Forum: RSpec [Cucumber] Enforce a skip on a non-implemented step

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.
Ee6788c2faaad7a5cd0bc466c9ea60d8?d=identicon&s=25 aidy lewis (Guest)
on 2009-02-25 12:13
(Received via mailing list)
Hi,

When we create step defintions. For example:

When /^that data is loaded$/ do

end

The above is seen in the Cucucmber run as implemented.

Is it possible to put something within this method to enforce a skip
flag?

Aidy
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-02-25 12:48
(Received via mailing list)
On Wed, Feb 25, 2009 at 11:52 AM, aidy lewis <aidy.lewis@googlemail.com>
wrote:
> Is it possible to put something within this method to enforce a skip flag?
>

I'm not sure I understand what you mean. You want to skip running
certain step definitions if a certain condition is true?

When /^that data is loaded$/ do
  unless ENV['MAGIC']
    # load the data
  end
end

$ MAGIC=true cucumber ...

Aslak
3c28deaff162aeda44f2e0bcdca1dacf?d=identicon&s=25 Joseph Wilk (josephwilk)
on 2009-02-25 13:53
(Received via mailing list)
aidy lewis wrote:
> Is it possible to put something within this method to enforce a skip flag?
>

Do you mean something like the 'pending' function but it instead marks
the step as skipped?

When /^that data is loaded$/ do
  skip
end



> Aidy
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
--

Joseph Wilk
http://blog.josephwilk.net
57e939ff00f9df2670a09f417c08da5e?d=identicon&s=25 Josh Knowles (Guest)
on 2009-02-25 16:15
(Received via mailing list)
On Wed, Feb 25, 2009 at 5:52 AM, aidy lewis <aidy.lewis@googlemail.com>
wrote:
> Hi,
>
> When we create step defintions. For example:
>
> When /^that data is loaded$/ do
>
> end


Are you familiar with the "pending" method?

i.e.

When /^that data is loaded$/
  pending
end
Ee6788c2faaad7a5cd0bc466c9ea60d8?d=identicon&s=25 aidy lewis (Guest)
on 2009-02-25 16:34
(Received via mailing list)
Hi Josh et al
On 25/02/2009, Josh Knowles <joshknowles@gmail.com> wrote:
>
> _______________________________________________
I was not familiar, but it is exactly what I needed.

Thanks

Aidy
This topic is locked and can not be replied to.