summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLuis Lavena <luislavena@gmail.com>2008-12-07 14:13:35 -0500
committerLuis Lavena <luislavena@gmail.com>2008-12-07 14:13:35 -0500
commit07e3d7c899f0d110144731959fe22a05a28f12cd (patch)
tree16dba1549d5f033b42593081c67cd7ae80717241 /spec
parent125e407c363e5eeed53492f945d321fd809af2aa (diff)
downloadrake-compiler-07e3d7c899f0d110144731959fe22a05a28f12cd.tar.gz
Allow RUBY_CC_VERSION to specify target Ruby version.
This makes 'rake cross compile' more flexible when multiple Ruby versions exists into rake-compiler directory.
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/rake/extensiontask_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/rake/extensiontask_spec.rb b/spec/lib/rake/extensiontask_spec.rb
index 181d24b..a2d9415 100644
--- a/spec/lib/rake/extensiontask_spec.rb
+++ b/spec/lib/rake/extensiontask_spec.rb
@@ -277,6 +277,20 @@ describe Rake::ExtensionTask do
}.should raise_error(RuntimeError, /no configuration section for this version of Ruby/)
end
+ it 'should allow usage of RUBY_CC_VERSION to indicate a different version of ruby' do
+ config = mock(Hash)
+ config.should_receive(:[]).with("rbconfig-2.0").and_return('/path/to/ruby/2.0/rbconfig.rb')
+ YAML.stub!(:load_file).and_return(config)
+ begin
+ ENV['RUBY_CC_VERSION'] = '2.0'
+ Rake::ExtensionTask.new('extension_one') do |ext|
+ ext.cross_compile = true
+ end
+ ensure
+ ENV.delete('RUBY_CC_VERSION')
+ end
+ end
+
describe "(cross for 'universal-unknown' platform)" do
before :each do
@ext = Rake::ExtensionTask.new('extension_one', @spec) do |ext|