# Testing with IronRuby Query

**URL:** <https://www.ruby-forum.com/t/testing-with-ironruby-query/180621>\
**Category:** IronRuby\
**Created:** [December 23, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/testing-with-ironruby-query/180621 "2009-12-23T18:59:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gordonm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/977dab/32.png) [@gordonm](https://www.ruby-forum.com/u/gordonm)\
**Post date:** [December 23, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/testing-with-ironruby-query/180621/1 "2009-12-23T18:59:45Z")

</div>

Hi,

I have just got IronRuby up and running. I’m intending on using it with  
Cucumber to test some of the DLLs on our server.

It all seems to have been set up correctly and I have require’d one of  
the DLLs from a location on our server. I have access to the DLL’s via a  
shared drive, but they are on a different machine to my own. The DLLs  
sit on the webserver in the bin directory within the wwwroot directory  
of an IIS server. The class interfaces are quite simple, but the DLLs do  
a lot of work calling other services, databases etc.

Now, on my machine, where my test scripts are, if I import one of these  
DLLs using

require ‘mydll.dll’

What does this actually do?

1. Does it make a copy of the DLL code which I can use but is running  
on my machine? Or;
2. Does it reference the DLL on the webserver itself such that I am  
running code on the webserver?

I ask as to test the DLLs effectively they will need to have the same  
resources available to them as on the webserver (access to the DB etc).  
If the code is running on my machine, then I can’t test effectively.

Any advice appreciated…

Thanks,

Gordon

---

<div class="post-metadata">

**Author:** ![gordonm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/977dab/32.png) [@gordonm](https://www.ruby-forum.com/u/gordonm)\
**Post date:** [December 31, 2009, 4:26pm UTC](https://www.ruby-forum.com/t/testing-with-ironruby-query/180621/2 "2009-12-31T16:26:06Z")

</div>

Gordon, Iâ€™m a bit confused about what youâ€™re trying to do â€¦ let me see  
if I understand â€¦

> It all seems to have been set up correctly and I have require’d one of  
> the DLLs from a location on our server. I have access to the DLL’s via a  
> shared drive, but they are on a different machine to my own. The DLLs  
> sit on the webserver in the bin directory within the wwwroot directory  
> of an IIS server. The class interfaces are quite simple, but the DLLs do  
> a lot of work calling other services, databases etc.

So you have a bunch of DLLs you want to use in IronRuby, and they are  
located on a shared drive on a different machine than where you want to  
run IronRuby on? Because Windows treats a shared drive just like a local  
drive, IronRuby will be able to access these files just fine.

> running code on the webserver?
> 
> I ask as to test the DLLs effectively they will need to have the same  
> resources available to them as on the webserver (access to the DB etc).  
> If the code is running on my machine, then I can’t test effectively.

All execution is happening on the machine running IronRuby; the DLLs  
bits are just being loaded from the shared drive. It sounds like thatâ€™s  
not what you want, as you need those DLLs be in their production  
environment to work correctly. To test those DLLs effectively, you  
either need to run IronRuby on the same machine as where those binaries  
will work, or you need to make those binaries work on your dev machine.

Keep in mind this is not a limitation of IronRuby; the problem you are  
trying to solve is not a job for just a programming language. Sounds  
like youâ€™d ideally want a web-service on your server so you can expose  
functionality you want to test to your dev machines. Or even something  
like remote procedure calls. But Iâ€™d just test these binaries in a  
special environment where the web services are mocked out; testing  
things in production is always tricky, and not always worth it.

~js

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Ivan Porto  
Carrero  
Sent: Wednesday, December 23, 2009 10:59 AM  
To: removed\_email\_address@domain.invalid  
Subject: Re: [Ironruby-core] Testing with IronRuby Query

when you do require ‘MyAssembly.dll’

ironruby looks in it’s search paths to see if it can find the file in  
one of those locations. If it exists it will just load the file with  
Assembly.LoadFromPath

Not much magic

## You may have to change the trust level in your .net security configuration to allow network locations but that counts for other .NET stuff too.

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Blog: [http://flanders.co.nz](http://flanders.co.nz)  
Google Wave:  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))

On Wed, Dec 23, 2009 at 6:59 PM, Gordon M.  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Hi,

I have just got IronRuby up and running. I’m intending on using it with  
Cucumber to test some of the DLLs on our server.

It all seems to have been set up correctly and I have require’d one of  
the DLLs from a location on our server. I have access to the DLL’s via a  
shared drive, but they are on a different machine to my own. The DLLs  
sit on the webserver in the bin directory within the wwwroot directory  
of an IIS server. The class interfaces are quite simple, but the DLLs do  
a lot of work calling other services, databases etc.

Now, on my machine, where my test scripts are, if I import one of these  
DLLs using

require ‘mydll.dll’

What does this actually do?

1. Does it make a copy of the DLL code which I can use but is running  
on my machine? Or;
2. Does it reference the DLL on the webserver itself such that I am  
running code on the webserver?

I ask as to test the DLLs effectively they will need to have the same  
resources available to them as on the webserver (access to the DB etc).  
If the code is running on my machine, then I can’t test effectively.

Any advice appreciated…

Thanks,

## Gordon

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Ironruby-core mailing list  
removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://rubyforge.org/mailman/listinfo/ironruby-core](http://rubyforge.org/mailman/listinfo/ironruby-core)
