summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_test_task.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_rake_test_task.rb')
-rw-r--r--test/rake/test_rake_test_task.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/rake/test_rake_test_task.rb b/test/rake/test_rake_test_task.rb
index 80fe9a28b4f..5c4be797c6f 100644
--- a/test/rake/test_rake_test_task.rb
+++ b/test/rake/test_rake_test_task.rb
@@ -97,17 +97,22 @@ class TestRakeTestTask < Rake::TestCase
end
def test_run_code_rake_default_gem
+ skip 'this ruby does not have default gems' unless
+ Gem::Specification.method_defined? :default_specifications_dir
+
default_spec = Gem::Specification.new 'rake', 0
default_spec.loaded_from = File.join Gem::Specification.default_specifications_dir, 'rake-0.gemspec'
- rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec
+ begin
+ rake, Gem.loaded_specs['rake'] = Gem.loaded_specs['rake'], default_spec
- test_task = Rake::TestTask.new do |t|
- t.loader = :rake
- end
+ test_task = Rake::TestTask.new do |t|
+ t.loader = :rake
+ end
- assert_match(/\A(-I".*?" *)* ".*?"\Z/, test_task.run_code)
- ensure
- Gem.loaded_specs['rake'] = rake
+ assert_match(/\A(-I".*?" *)* ".*?"\Z/, test_task.run_code)
+ ensure
+ Gem.loaded_specs['rake'] = rake
+ end
end
def test_run_code_testrb_ruby_1_8_2