Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created August 3, 2011 23:01
Show Gist options
  • Save tenderlove/1124080 to your computer and use it in GitHub Desktop.
Save tenderlove/1124080 to your computer and use it in GitHub Desktop.

Running exactly two test files

With just ruby:

$ ruby -Ilib:test -e'require "test1"; require "test2"'

Via your rake task:

$ rake TEST=test/test[1,2].rb
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
task :default => :test
require 'test/unit'
class Test1 < Test::Unit::TestCase
def test_one
assert_equal '1', 1.to_s
end
end
require 'test/unit'
class Test2 < Test::Unit::TestCase
def test_two
assert_equal '2', 2.to_s
end
end
require 'test/unit'
class Test3 < Test::Unit::TestCase
def test_three
assert_equal '3', 3.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment