Forum: RSpec cucumber/rspec pending call

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.
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-12-02 19:09
I have tried to do this in a step definition:

When /set the "(.*)" to "(.*)"/ do |a,v|
  pending
end

However, no matter how I invoke cucumber, I get this error:

    And I set the "type" to "main"                        #
features/locations/step_definitions/location_steps.rb:33
      TODO (Spec::Example::ExamplePendingError)
      /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/example/pending.rb:13:in
`pending'
      ./features/locations/step_definitions/location_steps.rb:34:in `And
/set the "(.*)" to "(.*)"/'
      features/locations/location.feature:24:in `And I set the "type" to
"main"'

My env.rb file looks like this:

# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) +
'/../../config/environment')
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures

# If webrat is a gem then uncomment this
require 'webrat' if !defined?(Webrat)

# If webrat is a plugin then uncomment this
#require 'webrat/rails'

# Comment out the next two lines if you're not using RSpec's matchers
(should / should_not) in your steps.
require 'cucumber/rails/rspec'
#require 'webrat/rspec-rails'
F68f69615423aa3851bd445409754dbf?d=identicon&s=25 Joseph Wilk (joesniff)
on 2008-12-02 19:18
(Received via mailing list)
James Byrne wrote:
>       TODO (Spec::Example::ExamplePendingError)
> ENV["RAILS_ENV"] = "test"
>
> # Comment out the next two lines if you're not using RSpec's matchers
> (should / should_not) in your steps.
> require 'cucumber/rails/rspec'
> #require 'webrat/rspec-rails'
>
'pending' is not supported yet.

There is some work waiting to be done on pending steps:
http://rspec.lighthouseapp.com/projects/16211/tick...

But I think it could do with a new ticket. Would you mind creating one
please?

Thanks,
--
Joseph Wilk
http://blog.josephwilk.net
F68f69615423aa3851bd445409754dbf?d=identicon&s=25 Joseph Wilk (joesniff)
on 2008-12-02 20:02
(Received via mailing list)
James Byrne wrote:
>       TODO (Spec::Example::ExamplePendingError)
> ENV["RAILS_ENV"] = "test"
>
> # Comment out the next two lines if you're not using RSpec's matchers
> (should / should_not) in your steps.
> require 'cucumber/rails/rspec'
> #require 'webrat/rspec-rails'
>
Having said that if you need an instant solution you can use:
@@@

When /set the "(.*)" to "(.*)"/ do |a,v|
  raise Cucumber::Pending.new("I need to implement this asap")
end
@@@

--
Joseph Wilk
http://blog.josephwilk.net
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-12-02 20:03
Joseph Wilk wrote:

> 'pending' is not supported yet.
>
> There is some work waiting to be done on pending steps:
> 
http://rspec.lighthouseapp.com/projects/16211/tick...
>
> But I think it could do with a new ticket. Would you mind creating one
> please?
>
> Thanks,

Here you got:

http://rspec.lighthouseapp.com/projects/16211-cucu...
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2008-12-02 20:47
Joseph Wilk wrote:

> When /set the "(.*)" to "(.*)"/ do |a,v|
>   raise Cucumber::Pending.new("I need to implement this asap")
> end

That works nicely.  The string argument does not show up anywhere that I
could find when this is invoked from autotest but the step definition
itself is treated as pending.  This technique also seems to have the
effect of escaping any following code in the definition block.
This topic is locked and can not be replied to.