Your required files need to be in a directory that's in your load path.
According to the file below you could put the toolkit directory (which I
assume contains testhook.rb) in the same directory as your script, lab5_1.rb
and it should work. If not, do a google search on ruby load path, you'll
find many references which might help you understand this.

-Charley

On 1/9/07, sarita <[EMAIL PROTECTED]> wrote:

require keyword is used to include files: require 'toolkit/testhook'

But when ruby is unable to find that file, it shows the following type of
error:


********************************************************************************************
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_re
quire': no such file to load -- toolkit/testhook (LoadError)
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
        from C:/DOCUME~1/sarita/Desktop/lab5_1.rb:7

*********************************************************************************************

But When I comment out the line with require keyword  & other related
lines, it successfully executes.

For example, in the following script I've commented out the lines in bold:


**********************************************************************************
# Suggested solution to Lab 5, Part 1, Start The Day w/ Assertions

# This line helps Ruby find the toolkit libraries
$LOAD_PATH << '..' if $0 == __FILE__

require 'watir'
#[b]require 'toolkit/testhook'[/b]
]require 'test/unit/assertions'
include Test::Unit::Assertions

# make sure we have a new user
user_name = 'ruby'
#[b]ensure_no_user_data(user_name)[/b]
# login
ie = Watir::IE.start('http://localhost:8080')
ie.text_field(:name, 'name').set(user_name)
ie.button(:value , 'Login').click

# create a background job
ie.text_field(:name, 'name').set('background')
ie.button(:value , 'Create').click

# start the day
ie.button(:name, 'start_day').click

# verify the status text
assert( ie.p(:id, 'last_results').text.include?( "Job 'background'
started" ))
assert( ie.p(:id, 'running_job').text.include?( "Job 'background' is
running." ))

# verify that the job appears in the recent records table
assert( ie.table(:id, 'recent_records')[2][1].text == 'background' )
assert( ie.table(:id, 'recent_records')[2][4].text == 'running' )

****************************************************************************
What's 'gem_original_require' in the error msg. How to overcome this
error, plz suggest.

Sarita
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6063&messageID=16982#16982
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to