Forum: RSpec various results from same test

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.
8cca7d40801c85f8f9bbb5e5b09ee50c?d=identicon&s=25 Jeremiah Heller (Guest)
on 2009-04-14 14:01
(Received via mailing list)
Hi,

I've read on the 'Cucumber Backgrounder' page that running cuc via
rake, command line and autotest could give different results but I
seem to get different results depending on the path I pass cucumber
and am not sure what's going on. I would be grateful for any help or
insight.

There's a fresh rails app with features/admin_management/
{crud_admins.feature,crud_admins_steps.rb} and the other default
files. webrat, rspec(-rails) and cucumber are installed as plugins
from their respective master branches (as of a couple hours ago) - I
had them installed as gems initially but now gems are all uninstalled
and only plugins reside.

crud_admins.feature; just has a single step:
  Scenario: Create an admin user
  Given I can see the form to create an admin user

crud_admins_steps.rb; just has a single step-def:
  Given "I can see the form to $action a(n)? $controller $domain" do |
action, _, controller, domain|
    visit path_to("#{action} #{controller} #{domain}")
  end

If I run `script/cucumber features/admin_management/
crud_admins.feature`; I see:
  undefined method `visit' for

If I run `script/cucumber features`; I see:
  No route matches "/admin/users/create"

which is what I expect.

There are no migrations yet; could that be an/the issue?

- Jeremiah
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-04-14 14:46
(Received via mailing list)
On Tue, Apr 14, 2009 at 1:32 PM, Jeremiah Heller
<jeremiah.heller@gmail.com>wrote:

> plugins from their respective master branches (as of a couple hours ago) - I
>          visit path_to("#{action} #{controller} #{domain}")
>
> There are no migrations yet; could that be an/the issue?
>

Can you post the full backtrace in addition to the error message?

Aslak
8cca7d40801c85f8f9bbb5e5b09ee50c?d=identicon&s=25 Jeremiah Heller (Guest)
on 2009-04-14 22:17
(Received via mailing list)
On 14 Apr 2009, at 05:41, aslak hellesoy wrote:

> If I run `script/cucumber features/admin_management/
> Can you post the full backtrace in addition to the error message?
Here it is. Thanks for taking a look.

undefined method `visit' for #<Object:0x11b50ac> (NoMethodError)
       ./features/admin_management/crud_admins_steps.rb:5:in
`__instance_exec0'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/core_ext/instance_exec.rb:60:in `send'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/core_ext/instance_exec.rb:60:in `instance_exec'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/core_ext/instance_exec.rb:20:in `cucumber_instance_exec'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/core_ext/instance_exec.rb:38:in
`cucumber_run_with_backtrace_filtering'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/core_ext/instance_exec.rb:10:in `cucumber_instance_exec'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/step_definition.rb:102:in `invoke'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/step_match.rb:13:in `invoke'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/step_invocation.rb:32:in `invoke'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/step_invocation.rb:22:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/visitor.rb:74:in `visit_step'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/formatter/pretty.rb:120:in `visit_step'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/step_collection.rb:14:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/step_collection.rb:13:in `each'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/step_collection.rb:13:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/visitor.rb:70:in `visit_steps'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/scenario.rb:33:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/step_mother.rb:201:in `before_and_after'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/scenario.rb:32:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/visitor.rb:45:in `visit_feature_element'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/formatter/pretty.rb:79:in `visit_feature_element'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/feature.rb:22:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/feature.rb:21:in `each'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/feature.rb:21:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/visitor.rb:23:in `visit_feature'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/formatter/pretty.rb:41:in `visit_feature'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/features.rb:21:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/features.rb:20:in `each'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/features.rb:20:in `accept'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/ast/visitor.rb:19:in `visit_features'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/formatter/pretty.rb:26:in `visit_features'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/broadcaster.rb:9:in `__send__'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/broadcaster.rb:9:in `method_missing'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/broadcaster.rb:8:in `map'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/broadcaster.rb:8:in `method_missing'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/cli/main.rb:41:in `execute!'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/../lib/
cucumber/cli/main.rb:20:in `execute'
       /Users/jf/Sites/tarbis/vendor/plugins/cucumber/bin/cucumber:6
       script/cucumber:3:in `load'
       script/cucumber:3
       features/admin_management/crud_admins.feature:7:in `Given I can
see the form to create an admin user'
This topic is locked and can not be replied to.