I am planning on using rspec for integration tests and cucumber for acceptance tests for my application. I wish to use the same page objects for both. I have placed my page objects in the lib directory and I have managed to get cucumber seeing the objects but for some reason rspec cant see the objects in the lib folder.
I have tried using the require_all method. So my spec helper has the following:
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'require_all'
require_all('lib')
my folder structure is as follows:
>selenium
>features (this contains my cucumber scenarios, support dir with env file etc)
>lib (this is the folder with the page objects contained in sub directories)
>spec
spec_helper.rb
>features (rspec scenarios)
>support
When I attempt to run a test using the command rspec testfile.rb I get the error message: 'rescue in require_all': no such file to load -- lib (LoadError)'
Anybody have any idea what I am doing wrong here? Any help would be greatly appreciated!
Thanks!