Permalink
Browse files

Add autotest sandbox for experiments. [admin]

  • Loading branch information...
1 parent c414e4a commit 9dbe8424a308012dd1aa83849a434b80a787f0cb @trans trans committed Feb 8, 2012
View
@@ -1,4 +1,5 @@
-coverage
+Gemfile.lock
+log
doc
pkg
tmp
@@ -0,0 +1,33 @@
+require "autotest/bundler"
+require 'autotest/growl'
+#require 'autotest/fsevent'
+require "autotest/restart"
+
+Autotest::Growl::one_notification_per_run = true
+Autotest::Growl::remote_notification = true
+
+#Autotest.add_hook :initialize do |autotest|
+# %w{.git .DS_Store tmp log}.each do |exception|
+# autotest.add_exception(exception)
+# end
+#end
+
+# Override autotest default magic to rerun all tests every time a
+# change is detected on the file system.
+#class Autotest
+#
+# def get_to_green
+# begin
+# rerun_all_tests
+# wait_for_changes unless all_good
+# end until all_good
+# end
+#
+#end
+
+Autotest.add_hook :initialize do |at|
+ at.testlib = 'lib/example'
+
+ at.extra_class_map["ExampleTest"] = "test/test_example.rb"
+end
+
@@ -0,0 +1,4 @@
+source :rubygems
+
+gem 'ZenTest'
+gem 'turn'
@@ -0,0 +1,5 @@
+class Example
+ def foo
+ "foo"
+ end
+end
@@ -0,0 +1,41 @@
+#require 'minitest/autorun'
+#require 'test/unit'
+require 'turn/autorun'
+
+Turn.config.ansi = true
+
+class ExampleTest < Test::Unit::TestCase
+ def test_sample_pass1
+ assert_equal(1,1)
+ end
+ def test_sample_pass2
+ assert_equal(2,2)
+ end
+
+ def test_sample_fail1
+ assert_equal(1,2)
+ end
+ def test_sample_fail2
+ assert_include(1,[])
+ end
+
+ def test_sample_error1
+ raise StandardError, "Raised exception!"
+ end
+ def test_sample_error2
+ raise StandardError, "Raised another exception!"
+ end
+end
+
+
+class SampleCase2 < Test::Unit::TestCase
+ def test_sample_pass1
+ assert_equal(1,1)
+ end
+ def test_sample_pass2
+ assert_equal(1,1)
+ end
+end
+
+class EmptyCase < Test::Unit::TestCase
+end

0 comments on commit 9dbe842

Please sign in to comment.