David,

        I've altered the rails app a little bit more -- basically, I
added /**/ to the front of the suite_dir because I have many test cases
in different subdirectories.  The problem now is the same as before -
the included .rb library file is at the top level, and the rails app
can't find it (of course).  I've experimented a bit with changing other
paths and adding statements to try to force it like you did, but haven't
been able to reach any other result.

        I've read up on Ruby/Rails for a solution, but I suppose I don't
quite understand exactly how Ruby is missing the file, so I don't
understand exactly how to point it in the right direction.  Do you see a
viable solution for this?

The portion with both of our edits looks like:

        suite_dir = "C:/runner/data/suites"
        session[:suite_dir] = suite_dir
        # Get all files found at suites/*.rb
        @suites = Dir[suite_dir + "/**/*.rb"]

The library file is c:/runner/data/suites/library.rb, and an example for
a suite dir would be c:/runner/data/suites/project/test.rb.

Thanks again,
Adam

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brown, David
Sent: Wednesday, March 28, 2007 3:39 PM
To: [email protected]
Subject: Re: [Wtr-general] watir execution from webserver

I had the same issue where the script would execute but couldn't find
any of the other 'required' files in the directory.  To solve this
problem, I had to add some code to the
"runner\app\controllers\runner_controller.rb" specifying the test suite
directory that the test should execute in.  Now it is working Great!
Here are the changes.:

Def index
        ...
    suite_dir = "T:/my test suite"
    session[:suite_dir] = suite_dir  #store it in the session so that it
can be used by the runsuite action.
        ...
End

Def runsuite
        ...
        #added the argument: "-Cdirectory"   --->    cd to directory,
before executing your script
        cmd = "ruby -C#{session[:suite_dir]} [EMAIL PROTECTED] -f -v verbose >
#{session[:console_filename]}"  
        ...
end



-David Brown

------------------------------

Message: 5
Date: Wed, 28 Mar 2007 14:28:56 CDT
From: John Lolis <[EMAIL PROTECTED]> areed,

I have noticed that paths in ruby are relative to file that is being
executed ( i think ). This has caused a couple of head scratching
moments on my part while i wonder they files will no longer load using
relative paths.

I'm not sure this is related to your problem, hope it helps.


_______________________________________________
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