Skip to content
Browse files

Smoke test for test_help

  • Loading branch information...
1 parent 508ffcc commit 947bbc170efc498499911d164eccd05db19a5c63 @josh josh committed
Showing with 38 additions and 0 deletions.
  1. +38 −0 railties/test/application/test_test.rb
View
38 railties/test/application/test_test.rb
@@ -0,0 +1,38 @@
+require 'isolation/abstract_unit'
+
+module ApplicationTests
+ class TestTest < Test::Unit::TestCase
+ include ActiveSupport::Testing::Isolation
+
+ def setup
+ build_app
+ boot_rails
+ end
+
+ test "truth" do
+ app_file 'test/unit/foo_test.rb', <<-RUBY
+ require 'test_helper'
+
+ class FooTest < ActiveSupport::TestCase
+ def test_truth
+ assert true
+ end
+ end
+ RUBY
+
+ run_test 'unit/foo_test.rb'
+ end
+
+ private
+ def run_test(name)
+ result = ruby '-Itest', "#{app_path}/test/#{name}"
+ assert_equal 0, $?.to_i, result
+ end
+
+ def ruby(*args)
+ Dir.chdir(app_path) do
+ `RUBYLIB='#{$:.join(':')}' #{Gem.ruby} #{args.join(' ')}`
+ end
+ end
+ end
+end

0 comments on commit 947bbc1

Please sign in to comment.
Something went wrong with that request. Please try again.