Skip to content

Instantly share code, notes, and snippets.

@agrimm
Created November 8, 2009 03:21
Show Gist options
  • Save agrimm/229074 to your computer and use it in GitHub Desktop.
Save agrimm/229074 to your computer and use it in GitHub Desktop.
[agrimm@computer_name test_example]$ more *.rb
::::::::::::::
without_run_equal.rb
::::::::::::::
require "test/unit"
class WithoutRunEqualTestCase < Test::Unit::TestCase
def test_truth
assert_equal 4, 2+2
end
end
::::::::::::::
with_run_equal_false.rb
::::::::::::::
require "test/unit"
class WithoutRunEqualTestCase < Test::Unit::TestCase
def test_truth
assert_equal 4, 2+2
end
end
Test::Unit.run = false
::::::::::::::
with_run_equal_true.rb
::::::::::::::
require "test/unit"
class WithoutRunEqualTestCase < Test::Unit::TestCase
def test_truth
assert_equal 4, 2+2
end
end
Test::Unit.run = true
[agrimm@computer_name test_example]$ ruby without_run_equal.rb
Loaded suite without_run_equal
Started
.
Finished in 0.001586 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
[agrimm@computer_name test_example]$ ruby with_run_equal_true.rb
[agrimm@computer_name test_example]$ ruby with_run_equal_false.rb
Loaded suite with_run_equal_false
Started
.
Finished in 0.001628 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment