mruby/mruby — pull request #802 by carsonmcdonald (2013-01-30 03:11:36+00:00)
Title: Add ability to pass parameters from mrbgem.rake spec into test scripts.

I wanted to see if others might be interested in this change. I thought of this because I need to access some binary files located in the test directory. Because the binary files aren't copied into the test build directory I copied them into Dir.tmpdir but there was no way of easily pushing that directory into the test script. This seemed like the easiest way of getting small bits of information from the spec into the test.

For example, in mrbgem.rake:

```ruby
MRuby::Gem::Specification.new('mruby-gem') do |spec|

# ...

FileUtils.cp_r(File.expand_path(File.dirname(__FILE__)) + '/test/abinaryfile', Dir::tmpdir)

spec.test_args = {'binary_file' => Dir::tmpdir + '/abinaryfile'}
end
```

In the test:

```ruby
assert('Test binary file') do
out = AGem::convert_file($test_args['binary_file'])
out.to_s == 'some output'
end
```