Skip to content

Commit

Permalink
updated for ruby 19 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jimweirich committed Sep 1, 2008
1 parent 75c6779 commit 5af487a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
21 changes: 11 additions & 10 deletions rakelib/ruby19.rake
Expand Up @@ -7,8 +7,8 @@ module Ruby19

SVN = "../thirdparty/ruby"

def run_tests(files)
sh "#{PROG} -Ilib lib/rake/rake_test_loader.rb #{files}"
def run_tests(files, opts='')
sh "#{PROG} -Ilib lib/rake/rake_test_loader.rb #{opts} #{files}"
end

extend self
Expand Down Expand Up @@ -41,7 +41,7 @@ namespace "ruby19" do
File.directory?(Ruby19::SVN)
end


namespace "test" do

desc "Check the file paths"
Expand All @@ -58,24 +58,25 @@ namespace "ruby19" do
task :version => [:env19] do
sh "#{Ruby19::PROG} --version", :verbose => false
sh "#{Ruby19::PROG} -rubygems -e 'puts \"Gem Path = \#{Gem.path}\"'", :verbose => false
sh "#{Ruby19::PROG} -Ilib bin/rake --version"
end

desc "Run the unit tests in Ruby 1.9"
task :units => [:env19] do
test_files = FileList['test/test_*.rb']
Ruby19.run_tests(test_files)
task :units, :opts, :needs => [:env19] do |t, args|
test_files = FileList['test/**/test_*.rb']
Ruby19.run_tests(test_files, args.opts)
end

desc "Run the functional tests in Ruby 1.9"
task :functionals => [:env19] do
task :functionals, :opts, :needs => [:env19] do |t, args|
test_files = FileList['test/functional.rb']
Ruby19.run_tests(test_files)
Ruby19.run_tests(test_files, args.opts)
end

desc "Run the all the tests in Ruby 1.9"
task :all => [:env19] do
task :all, :opts, :needs => [:env19] do |t, args|
test_files = FileList['test/functional.rb', 'test/test_*.rb']
Ruby19.run_tests(test_files)
Ruby19.run_tests(test_files, args.opts)
end
end
end
File renamed without changes.
2 changes: 2 additions & 0 deletions test/in_environment.rb
Expand Up @@ -18,6 +18,8 @@ def set_env(settings) # :nodoc:
result[k] = ENV[k]
if k == 'PWD'
Dir.chdir(v)
elsif v.nil?
ENV.delete(k)
else
ENV[k] = v
end
Expand Down
6 changes: 0 additions & 6 deletions test/session_functional.rb
Expand Up @@ -29,8 +29,6 @@ class FunctionalTest < Test::Unit::TestCase

def setup
@rake_path = File.expand_path("bin/rake")
@coverage_aggregate_file = File.expand_path("rcov_aggregate")
@rcov_dir = File.expand_path("coverage")
lib_path = File.expand_path("lib")
@ruby_options = "-I#{lib_path} -I."
@verbose = ! ENV['VERBOSE'].nil?
Expand Down Expand Up @@ -306,10 +304,6 @@ def format_command=(fmt_command)
end

def rake(*option_list)
# self.class.format_command = lambda { |ruby_options, rake_path, options|
# "rcov --output=#{@rcov_dir} --aggregate=#{@coverage_aggregate_file} #{ruby_options} #{rake_path} -- #{options}"
# }

options = option_list.join(' ')
shell = Session::Shell.new
command = self.class.format_command[@ruby_options, @rake_path, options]
Expand Down
4 changes: 3 additions & 1 deletion test/test_application.rb
Expand Up @@ -199,7 +199,9 @@ def test_good_run
@app.instance_eval do
intern(Rake::Task, "default").enhance { ran = true }
end
@app.run
in_environment("PWD" => "test/data/default") do
@app.run
end
assert ran
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_task_manager.rb
Expand Up @@ -53,7 +53,7 @@ def test_create_filetask_in_namespace
assert_equal ["fn"], @tm.tasks.collect { |t| t.name }
end

def testS_namespace_yields_same_namespace_as_returned
def test_namespace_yields_same_namespace_as_returned
yielded_namespace = nil
returned_namespace = @tm.in_namespace("x") do |ns|
yielded_namespace = ns
Expand Down

0 comments on commit 5af487a

Please sign in to comment.