Please sign in to comment.
fix main in files w/ classes of same name contained in them
if we're in a file w/ a name that's the same as a class contained by it, and we've decided to generate a main for that class from statements in the file outside the class body, don't close the class until after the main method has been generated
- Loading branch information...
Showing with 28 additions and 2 deletions.
|@@ -0,0 +1,15 @@|
|+class TestMainMethod < Test::Unit::TestCase|
|+ def test_main_generation_for_file_with_class_of_same_name|
|+ code = <<-EOC|
|+ class WithMain|
|+ puts 'bar'|
|+ main_class, = compile code, 'with_main'|
|+ assert_output "bar\n" do|