The load path basically determines where ir.exe looks for assemblies and
files to load.

if you do

$LOAD_PATH.unshift(File.dirname(__FILE__) +"/bin/Debug")
and then require Watin.Core.dll the CLR knows where to look for your DLL's
including the referenced assemblies

You might have gotten a correct result by including your assemblies in the
inverted order too

So either you do :

$LOAD_PATH.unshift(File.dirname(__FILE__) +"/bin/Debug")
require 'BusinessObjects.dll'
require 'WatiN.Core.dll'

or this might work too:

require File.dirname(__FILE__) +"/bin/Debug/Interop.SHDocVw.dll"
require File.dirname(__FILE__) +"/bin/Debug/Microsoft.mshtml.dll"
require File.dirname(__FILE__) +"/bin/Debug/BusinessObjects.dll"
require File.dirname(__FILE__) +"/bin/Debug/WatiN.Core.dll"

---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero

On Mon, Jun 21, 2010 at 6:54 PM, Mohammad Azam <li...@ruby-forum.com> wrote:

> Ivan Porto Carrero wrote:
> > instead of requiring the files with path. maybe try to set the load path
> >
> > $:.unshift( File.dirname(__FILE__) + "/bin/Debug")
> > require 'BusinessObjects.dll'
> > require 'WatiN.Core.dll'
> > require 'Microsoft.mshtml.dll'
> > require 'Interop.SHDocVw.dll'
> >
> > I also think that the last 2 are redundant.. they should get picked up
> > automatically by Watin.Core isn't it
> > ---
> > Met vriendelijke groeten - Best regards - Salutations
> > Ivan Porto Carrero
> > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz
> > Twitter: http://twitter.com/casualjim
> > Author of IronRuby in Action (http://manning.com/carrero)
> > Microsoft IronRuby/C# MVP
>
>
> You are right! It should be loaded automatically but for some reason it
> is not. Here is my IronRuby code:
>
>
> require 'rubygems'
> require 'spec'
>
> require File.dirname(__FILE__) + '/bin/Debug/BusinessObjects.dll'
> require File.dirname(__FILE__) + '/bin/Debug/WatiN.Core.dll'
>
> include BusinessObjects
> include WatiN
>
> describe Account, "when something happens" do
>
> before do
>
> IE = WatiN::Core::IE
>
> i = IE.new()
>
> end
>
> it "should do something" do
>
>
>
> end
>
> end
>
>
>
> And here is the error I get:
>
> C:\Projects\TestingIronRuby\BusinessObjects\BusinessObjects>ir -S spec
> testaccou
> ntbalanceUI.rb
> F
>
> 1)
> Errno::ENOENT in 'BusinessObjects::Account when something happens should
> do some
> thing'
> Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0,
> Culture=neutr
> al, PublicKeyToken=db7cfd3acb5ad44e' or one of its dependencies. The
> system cann
> ot find the file specified.
> ./testaccountbalanceUI.rb:19:
>
> Finished in 0.150009 seconds
>
> 1 example, 1 failure
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to