<br><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 4:25 PM, Stephen Veit <span dir="ltr"><<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I added cucumber to my rails project using the following commands:<br>
<br>
git submodule add git://<a href="http://github.com/aslakhellesoy/cucumber.git" target="_blank">github.com/aslakhellesoy/cucumber.git</a> \<br>
vendor/plugins/cucumber<br>
ruby script/generate cucumber<br>
git submodule add git://<a href="http://github.com/brynary/webrat.git" target="_blank">github.com/brynary/webrat.git</a> \<br>
vendor/plugins/webrat<br>
git submodule add git://<a href="http://github.com/dchelimsky/rspec.git" target="_blank">github.com/dchelimsky/rspec.git</a> \<br>
vendor/plugins/rspec<br>
git submodule add git://<a href="http://github.com/dchelimsky/rspec-rails.git" target="_blank">github.com/dchelimsky/rspec-rails.git</a> \<br>
vendor/plugins/rspec-rails<br>
script/generate rspec<br>
<br>
I create a feature that used steps that included visits. I got the<br>
following error:<br>
<br>
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in<br>
`gem_original_require': no such file to load -- webrat (LoadError)<br>
<br>
This occurred at line 4 in webrat_steps.rb<br>
<br>
So I commented out that line and added "require 'webrat'" to env.rb<br>
<br>
This time I got the following error:<br>
<br>
undefined method `visits' for<br>
#<ActionController::Integration::Session:0x7f3d871693d0> (NoMethodError)<br>
<br>
So I had to change the require in env.rb to<br>
<br>
require 'webrat/rails'<br>
<br>
It worked but I got the following deprecation errors:<br>
<br>
visits is deprecated. Use visit instead.<br>
fills_in is deprecated. Use fill_in instead.<br>
clicks_button is deprecated. Use click_button instead.<br>
<br>
I changed these in my steps file, and it worked fine.<br>
<br>
</blockquote><div><br>I just (1 hour ago) incorporated some recent Cucumber changes from Bryan (who writes Webrat) and released cucumber <a href="http://0.1.11.">0.1.11.</a><br>Can you try with the latest release? It should work well with Bryan's latest webrat.<br>
<br>Cheers,<br>Aslak<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
The problem with requiring webrat from webrat_steps, is that when this<br>
line is executed, the $LOAD_PATHS has not been modified to include the<br>
plugin lib directories. That is done by support/env.rb. The rake task<br>
"features" creates a command line that looks like:<br>
<br>
-I<br>
"/home/sveit/Projects/rails/varsitytutors/vendor/plugins/cucumber/lib"<br>
"/home/sveit/Projects/rails/varsitytutors/vendor/plugins/cucumber/bin/cucumber"<br>
--format pretty --require features/step_definitions/user_steps.rb<br>
--require features/step_definitions/webrat_steps.rb --require<br>
features/step_definitions/frooble_steps.rb --require<br>
features/support/env.rb features/manage_users.feature<br>
<br>
"support/env.rb" is required after "step_definitions/webrat_steps.rb".<br>
this should probably be changed.<br>
<font color="#888888">--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</font></blockquote></div><br>