Run ruby test and include require


 
Thread Tools Search this Thread
Top Forums Programming Run ruby test and include require
# 1  
Old 01-30-2013
Run ruby test and include require

I want to run a test for the gem mini_magick:
https://github.com/minimagick/minimagick

I got the directory lib, inside of which i got:
- mini_magick.rb
- mini_gmagick.rb

and inside of the test folder is the test i need to run:
- image_test.rb
and a helper file called:
- test_helper.rb

When i run
ruby test/image_test.rb
i get this error:
Code:
$ ruby test/image_test.rb 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test_helper (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from test/image_test.rb:1:in `<main>'

I was adviced to use -l to include libraries (similar to):
Code:
ruby -l lib -l test/test_helper.rb test/image_test.rb

but without success. So i looked at "man ruby", found -r, but that didn't help neither.

How can i run the tests manually ?
Thanks in advance.
# 2  
Old 02-07-2013
Using the full path would work:
Code:
require '~/Build/build_mini_magick/ruby-mini-magick/ruby-mini-magick/test/test_helper'

But if i understand this correct:
Ruby require local file problem - Ruby Forum
then i don't understand why require 'test_helper' doesn't work. I run it from the working directory, which contains image_test.rb and test_helper.rb.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script require to do telnet & run few commands

I am new in scripting, I need script(BASH) which do telenet to one of the elements & run few commands , after running it successfully it will check status of files & exit. Help is greatly appreciated 🙏 (2 Replies)
Discussion started by: Vinesh_123
2 Replies

2. Shell Programming and Scripting

Run sequential test files

I have c program that I run like this: ./a.out t1 And my test files look like this all the way up to 100: t1 t2 t3 Is there a way to run this more efficiently so I don't have to hit up and change the number every time? (4 Replies)
Discussion started by: cokedude
4 Replies

3. Shell Programming and Scripting

Include libexec directory for script when run

Hi everyone! This is my first post, so bear with me. I have this script, vpm, which make use of the libexec directory for commands intended to be run by the bin/vpm binary. I want to add the libexec directory to $PATH when running the vpm binary. I don't want the script itself to try figure... (2 Replies)
Discussion started by: KevinSjoberg
2 Replies

4. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

5. UNIX for Dummies Questions & Answers

No idea how to run it, may require gstreamer pluggins

Hello , i want to work on Gstreamer.i am attaching a file here . please have a look at that and let me know on which system it gets compiled . i guess the file is related to gstreamer code, and when i run the files its giving many errors. i am using red hat linux. is it possible to install... (0 Replies)
Discussion started by: juststarted
0 Replies

6. HP-UX

test program(dlopen) fails on hp but run well on solaris

Hi, I have a c test program which test dlopen call. This program run well on solaris but fails on hp-ux. The program load jvm library successfully on solaris. On hp-ux it displays error I compile this program as $cc -o testjvm testjvm.c What am I missing? I have tried... (2 Replies)
Discussion started by: shriashishpatil
2 Replies

7. UNIX Desktop Questions & Answers

Does it require each x-client sould run in separate process?

Hi Every One, I got a Basic doubts about clients on X-Server environment. 1) First of all what is mend by one client. (as per my understanding one application which is connected to X-server). 2) if i say two clients connected to my X-Server from the same machine, does it mean that two... (0 Replies)
Discussion started by: ps_sureshreddi
0 Replies
Login or Register to Ask a Question